IU Bigger than range strategyDESCRIPTION 
IU Bigger Than Range Strategy is designed to capture breakout opportunities by identifying candles that are significantly larger than the previous range. It dynamically calculates the high and low of the last N candles and enters trades when the current candle's range exceeds the previous range. The strategy includes multiple stop-loss methods (Previous High/Low, ATR, Swing High/Low) and automatically manages take-profit and stop-loss levels based on user-defined risk-to-reward ratios. This versatile strategy is optimized for higher timeframes and assets like BTC but can be fine-tuned for different instruments and intervals.
 USER INPUTS: 
Look back Length: Number of candles to calculate the high-low range. Default is 22.
Risk to Reward: Sets the target reward relative to the stop-loss distance. Default is 3.
Stop Loss Method: Choose between:(Default is "Previous High/Low")
- Previous High/Low
- ATR (Average True Range)
- Swing High/Low
ATR Length: Defines the length for ATR calculation (only applicable when ATR is selected as the stop-loss method) (Default is 14).
ATR Factor: Multiplier applied to the ATR to determine stop-loss distance(Default is 2).
Swing High/Low Length: Specifies the length for identifying swing points (only applicable when Swing High/Low is selected as the stop-loss method).(Default is 2)
 LONG CONDITION: 
The current candle’s range (absolute difference between open and close) is greater than the previous range.
The closing price is higher than the opening price (bullish candle).
 SHORT CONDITIONS: 
The current candle’s range exceeds the previous range.
The closing price is lower than the opening price (bearish candle).
 LONG EXIT: 
Stop-loss:
- Previous Low
- ATR-based trailing stop
- Recent Swing Low
 Take-profit: 
- Defined by the Risk-to-Reward ratio (default 3x the stop-loss distance).
 SHORT EXIT: 
Stop-loss:
- Previous High
- ATR-based trailing stop
- Recent Swing High
 Take-profit: 
- Defined by the Risk-to-Reward ratio (default 3x the stop-loss distance).
 ALERTS: 
Long Entry Triggered
Short Entry Triggered
 WHY IT IS UNIQUE: 
This strategy dynamically adapts to different market conditions by identifying candles that exceed the previous range, ensuring that it only enters trades during strong breakout scenarios.
Multiple stop-loss methods provide flexibility for different trading styles and risk profiles.
The visual representation of stop-loss and take-profit levels with color-coded plots improves trade monitoring and decision-making.
 HOW USERS CAN BENEFIT FROM IT: 
Ideal for breakout traders looking to capitalize on momentum-driven price moves.
Provides flexibility to customize stop-loss methods and fine-tune risk management parameters.
Helps minimize drawdowns with a strong risk-to-reward framework while maximizing profit potential.
Cerca negli script per "high low"
HTF Hi-Lo Zones [CHE]HTF Hi-Lo Zones Indicator 
The HTF Hi-Lo Zones Indicator is a Pine Script tool designed to highlight important high and low values from a selected higher timeframe. It provides traders with clear visual zones where price activity has reached significant points, helping in decision-making by identifying potential support and resistance levels. This indicator is customizable, allowing users to select the resolution type, control the visualization of session ranges, and even display detailed information about the chosen timeframe.
  Key Functionalities 
1. Timeframe Resolution Selection:
   - The indicator offers three modes to determine the resolution:
     - Automatic: Dynamically calculates the higher timeframe based on the current chart's resolution.
     - Multiplier: Allows users to apply a multiplier to the current chart's timeframe.
     - Manual: Enables manual input for custom resolution settings.
   - Each resolution type ensures flexibility to suit different trading styles and strategies.
2. Data Fetching for High and Low Values:
   - The indicator retrieves the current high and low values for the selected higher timeframe using `request.security`.
   - It also calculates the lowest and highest values over a configurable lookback period, providing insights into significant price movements within the chosen timeframe.
3. Session High and Low Detection:
   - The indicator detects whether the current value represents a new session high or low by comparing the highest and lowest values with the current data.
   - This is crucial for identifying breakouts or significant turning points during a session.
4. Visual Representation:
   - When a new session high or low is detected:
     - Range Zones: A colored box marks the session's high-to-low range.
     - Labels: Optional labels indicate "New High" or "New Low" for clarity.
   - Users can customize colors, transparency, and whether range outlines or labels should be displayed.
5. Information Box:
   - An optional dashboard displays details about the chosen timeframe resolution and current session activity.
   - The box's size, position, and colors are fully customizable.
6. Session Tracking:
   - Tracks session boundaries, updating the visualization dynamically as the session progresses.
   - Displays session-specific maximum and minimum values if enabled.
7. Additional Features:
   - Configurable dividers for session or daily boundaries.
   - Transparency and styling options for the displayed zones.
   - A dashboard for advanced visualization and information overlay.
  Key Code Sections Explained 
1. Resolution Determination:
   - Depending on the user's input (Auto, Multiplier, or Manual), the script determines the appropriate timeframe resolution for higher timeframe analysis.
   - The resolution adapts dynamically based on intraday, daily, or higher-period charts.
2. Fetching Security Data:
   - Using the `getSecurityDataFunction`, the script fetches high and low values for the chosen timeframe, including historical and real-time data management to avoid repainting issues.
3. Session High/Low Logic:
   - By comparing the highest and lowest values over a lookback period, the script identifies whether the current value is a new session high or low, updating session boundaries and initiating visual indicators.
4. Visualization:
   - The script creates visual representations using `box.new` for range zones and `label.new` for session labels.
   - These elements update dynamically to reflect the most recent data.
5. Customization Options:
   - Users can configure the appearance, behavior, and displayed data through multiple input options, ensuring adaptability to individual trading preferences.
This indicator is a robust tool for tracking higher timeframe activity, offering a blend of automation, customization, and visual clarity to enhance trading strategies.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Best regards and happy trading
Chervolino
CandleCandle: A Comprehensive Pine Script™ Library for Candlestick Analysis 
 Overview 
The Candle library, developed in Pine Script™, provides traders and developers with a robust toolkit for analyzing candlestick data. By offering easy access to fundamental candlestick components like open, high, low, and close prices, along with advanced derived metrics such as body-to-wick ratios, percentage calculations, and volatility analysis, this library enables detailed insights into market behavior.
This library is ideal for creating custom indicators, trading strategies, and backtesting frameworks, making it a powerful resource for any Pine Script™ developer.
 Key Features 
 1. Core Candlestick Data 
 •    Open : Access the opening price of the current candle.
 •    High : Retrieve the highest price.
 •    Low : Retrieve the lowest price.
 •    Close : Access the closing price.
 2. Candle Metrics 
 •    Full Size : Calculates the total range of the candle (high - low).
 •    Body Size : Computes the size of the candle’s body (open - close).
 •    Wick Size : Provides the combined size of the upper and lower wicks.
 3. Wick and Body Ratios 
 •    Upper Wick Size  and  Lower Wick Size .
 •    Body-to-Wick Ratio  and  Wick-to-Body Ratio .
 4. Percentage Calculations 
 •    Upper Wick Percentage : The proportion of the upper wick size relative to the full candle size.
 •    Lower Wick Percentage : The proportion of the lower wick size relative to the full candle size.
 •    Body Percentage  and  Wick Percentage  relative to the candle’s range.
 5. Candle Direction Analysis 
 •   Determines if a candle is "Bullish" or "Bearish" based on its closing and opening prices.
 6. Price Metrics 
 •    Average Price : The mean of the open, high, low, and close prices.
 •    Midpoint Price : The midpoint between the high and low prices.
 7. Volatility Measurement 
 •   Calculates the standard deviation of the OHLC prices, providing a volatility metric for the current candle.
 Code Architecture 
 Example Functionality 
The library employs a modular structure, exporting various functions that can be used independently or in combination. For instance:
 
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © DevArjun
//@version=6
indicator("Candle Data", overlay = true)
import DevArjun/Candle/1 as Candle
// Body Size %
bodySize = Candle.BodySize()
// Determining the candle direction
candleDirection = Candle.CandleDirection()
// Calculating the volatility of the current candle
volatility = Candle.Volatility()
// Plotting the metrics (for demonstration)
plot(bodySize, title="Body Size", color=color.blue)
label.new(bar_index, high, candleDirection, style=label.style_circle)
 
 Scalability 
The modularity of the Candle library allows seamless integration into more extensive trading systems. Functions can be mixed and matched to suit specific analytical or strategic needs.
 Use Cases 
 Trading Strategies 
Developers can use the library to create strategies based on candle properties such as:
 •   Identifying long-bodied candles (momentum signals).
 •   Detecting wicks as potential reversal zones.
 •   Filtering trades based on candle ratios.
 Visualization 
Plotting components like body size, wick size, and directional labels helps visualize market behavior and identify patterns.
 Backtesting 
By incorporating volatility and ratio metrics, traders can design and test strategies on historical data, ensuring robust performance before live trading.
 Education 
This library is a great tool for teaching candlestick analysis and how each component contributes to market behavior.
 Portfolio Highlights 
 Project Objective 
To create a Pine Script™ library that simplifies candlestick analysis by providing comprehensive metrics and insights, empowering traders and developers with advanced tools for market analysis.
 Development Challenges and Solutions 
 •    Challenge : Achieving high precision in calculating ratios and percentages.
 •    Solution : Implemented robust mathematical operations and safeguarded against division-by-zero errors.
 •    Challenge : Ensuring modularity and scalability.
 •    Solution : Designed functions as independent modules, allowing flexible integration.
 Impact 
 •    Efficiency : The library reduces the time required to calculate complex candlestick metrics.
 •    Versatility : Supports various trading styles, from scalping to swing trading.
 •    Clarity : Clean code and detailed documentation ensure usability for developers of all levels.
 Conclusion 
The Candle library exemplifies the power of Pine Script™ in simplifying and enhancing candlestick analysis. By including this project in your portfolio, you showcase your expertise in:
 •   Financial data analysis.
 •   Pine Script™ development.
 •   Creating tools that solve real-world trading challenges.
This project demonstrates both technical proficiency and a keen understanding of market analysis, making it an excellent addition to your professional portfolio.
Library   "Candle" 
A comprehensive library to access and analyze the basic components of a candlestick, including open, high, low, close prices, and various derived metrics such as full size, body size, wick sizes, ratios, percentages, and additional analysis metrics.
 Open() 
  Open
@description Returns the opening price of the current candle.
  Returns: float - The opening price of the current candle.
 High() 
  High
@description Returns the highest price of the current candle.
  Returns: float - The highest price of the current candle.
 Low() 
  Low
@description Returns the lowest price of the current candle.
  Returns: float - The lowest price of the current candle.
 Close() 
  Close
@description Returns the closing price of the current candle.
  Returns: float - The closing price of the current candle.
 FullSize() 
  FullSize
@description Returns the full size (range) of the current candle (high - low).
  Returns: float - The full size of the current candle.
 BodySize() 
  BodySize
@description Returns the body size of the current candle (open - close).
  Returns: float - The body size of the current candle.
 WickSize() 
  WickSize
@description Returns the size of the wicks of the current candle (full size - body size).
  Returns: float - The size of the wicks of the current candle.
 UpperWickSize() 
  UpperWickSize
@description Returns the size of the upper wick of the current candle.
  Returns: float - The size of the upper wick of the current candle.
 LowerWickSize() 
  LowerWickSize
@description Returns the size of the lower wick of the current candle.
  Returns: float - The size of the lower wick of the current candle.
 BodyToWickRatio() 
  BodyToWickRatio
@description Returns the ratio of the body size to the wick size of the current candle.
  Returns: float - The body to wick ratio of the current candle.
 UpperWickPercentage() 
  UpperWickPercentage
@description Returns the percentage of the upper wick size relative to the full size of the current candle.
  Returns: float - The percentage of the upper wick size relative to the full size of the current candle.
 LowerWickPercentage() 
  LowerWickPercentage
@description Returns the percentage of the lower wick size relative to the full size of the current candle.
  Returns: float - The percentage of the lower wick size relative to the full size of the current candle.
 WickToBodyRatio() 
  WickToBodyRatio
@description Returns the ratio of the wick size to the body size of the current candle.
  Returns: float - The wick to body ratio of the current candle.
 BodyPercentage() 
  BodyPercentage
@description Returns the percentage of the body size relative to the full size of the current candle.
  Returns: float - The percentage of the body size relative to the full size of the current candle.
 WickPercentage() 
  WickPercentage
@description Returns the percentage of the wick size relative to the full size of the current candle.
  Returns: float - The percentage of the wick size relative to the full size of the current candle.
 CandleDirection() 
  CandleDirection
@description Returns the direction of the current candle.
  Returns: string - "Bullish" if the candle is bullish, "Bearish" if the candle is bearish.
 AveragePrice() 
  AveragePrice
@description Returns the average price of the current candle (mean of open, high, low, and close).
  Returns: float - The average price of the current candle.
 MidpointPrice() 
  MidpointPrice
@description Returns the midpoint price of the current candle (mean of high and low).
  Returns: float - The midpoint price of the current candle.
 Volatility() 
  Volatility
@description Returns the standard deviation of the OHLC prices of the current candle.
  Returns: float - The volatility of the current candle.
supertrendLibrary   "supertrend" 
supertrend : Library dedicated to different variations of supertrend
 supertrend_atr(length, multiplier, atrMaType, source, highSource, lowSource, waitForClose, delayed) 
  supertrend_atr: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
  Parameters:
     length (simple int) : : ATR Length
     multiplier (simple float) : : ATR Multiplier
     atrMaType (simple string) : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
     source (float) : : Default is close. Can Chose custom source
     highSource (float) : : Default is high. Can also use close price for both high and low source
     lowSource (float) : : Default is low. Can also use close price for both high and low source
     waitForClose (simple bool) : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
     delayed (simple bool) : : if set to true lags supertrend atr stop based on target levels.
  Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
 supertrend_bands(bandType, maType, length, multiplier, source, highSource, lowSource, waitForClose, useTrueRange, useAlternateSource, alternateSource, sticky) 
  supertrend_bands: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
  Parameters:
     bandType (simple string) : : Type of band used - can be bb, kc or dc
     maType (simple string) : : Moving Average type for Bands. This can be sma, ema, hma, rma, wma, vwma, swma
     length (simple int) : : Band Length
     multiplier (float) : : Std deviation or ATR multiplier for Bollinger Bands and Keltner Channel
     source (float) : : Default is close. Can Chose custom source
     highSource (float) : : Default is high. Can also use close price for both high and low source
     lowSource (float) : : Default is low. Can also use close price for both high and low source
     waitForClose (simple bool) : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
     useTrueRange (simple bool) : : Used for Keltner channel. If set to false, then high-low is used as range instead of true range
     useAlternateSource (simple bool) : - Custom source is used for Donchian Chanbel only if useAlternateSource is set to true
     alternateSource (float) : - Custom source for Donchian channel
     sticky (simple bool) : : if set to true borders change only when price is beyond borders.
  Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
 supertrend_zigzag(length, history, useAlternativeSource, alternativeSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) 
  supertrend_zigzag: Zigzag pivot based supertrend
  Parameters:
     length (simple int) : : Zigzag Length
     history (simple int) : : number of historical pivots to consider
     useAlternativeSource (simple bool) 
     alternativeSource (float) 
     source (float) : : Default is close. Can Chose custom source
     highSource (float) : : Default is high. Can also use close price for both high and low source
     lowSource (float) : : Default is low. Can also use close price for both high and low source
     waitForClose (simple bool) : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
     atrlength (simple int) : : ATR Length
     multiplier (simple float) : : ATR Multiplier
     atrMaType (simple string) : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
  Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
 zupertrend(length, history, useAlternativeSource, alternativeSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) 
  zupertrend: Zigzag pivot based supertrend
  Parameters:
     length (simple int) : : Zigzag Length
     history (simple int) : : number of historical pivots to consider
     useAlternativeSource (simple bool) 
     alternativeSource (float) 
     source (float) : : Default is close. Can Chose custom source
     highSource (float) : : Default is high. Can also use close price for both high and low source
     lowSource (float) : : Default is low. Can also use close price for both high and low source
     waitForClose (simple bool) : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
     atrlength (simple int) : : ATR Length
     multiplier (simple float) : : ATR Multiplier
     atrMaType (simple string) : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
  Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
 zsupertrend(zigzagpivots, history, source, highSource, lowSource, waitForClose, atrMaType, atrlength, multiplier) 
  zsupertrend: Same as zigzag supertrend. But, works on already calculated array rather than Calculating fresh zigzag
  Parameters:
     zigzagpivots (array) : : Precalculated zigzag pivots
     history (simple int) : : number of historical pivots to consider
     source (float) : : Default is close. Can Chose custom source
     highSource (float) : : Default is high. Can also use close price for both high and low source
     lowSource (float) : : Default is low. Can also use close price for both high and low source
     waitForClose (simple bool) : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
     atrMaType (simple string) : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
     atrlength (simple int) : : ATR Length
     multiplier (simple float) : : ATR Multiplier
  Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
UVR Crypto TrendINDICATOR OVERVIEW: UVR CRYPTO TREND 
The UVR Crypto Trend indicator is a custom-built tool designed specifically for cryptocurrency markets, utilizing advanced volatility, momentum, and trend-following techniques. It aims to identify trend reversals and provide buy and sell signals by analyzing multiple factors, such as price volatility(UVR), RSI (Relative Strength Index), CMF (Chaikin Money Flow), and EMA (Exponential Moving Average). The indicator is optimized for CRYPTO MARKETS only.
 KEY FEATURES AND HOW IT WORKS 
 Volatility Analysis with UVR 
The UVR (Ultimate Volatility Rate) is a proprietary calculation that measures market volatility by comparing significant price extremes and smoothing the data over time.
 Purpose:  UVR aims to reduce noise in low-volatility environments and highlight significant movements during higher-volatility periods. While it strives to improve filtering in low-volatility conditions, it does not guarantee perfect performance, making it a balanced and adaptable tool for dynamic markets like cryptocurrency.
 HOW UVR (ULTIMATE VOLATILITY RATE) IS CALCULATED 
UVR is calculated using a method that ensures precise measurement of market volatility by comparing price extremes across consecutive candles:
 Volatility Components: 
Two values are calculated to represent potential price fluctuations:
The absolute difference between the current candle's high and the previous candle's low:
Volatility Component 1=∣High−Low ∣
The absolute difference between the previous candle's high and the current candle's low:
Volatility Component 2=∣High −Low∣
 Volatility Ratio: 
The larger of the two components is selected as the Volatility Ratio, ensuring UVR captures the most significant movement:
Volatility Ratio=max(Volatility Component 1,Volatility Component 2)
 Smoothing with SMMA: 
To stabilize the volatility calculation, the Volatility Ratio is smoothed using a Smoothed Moving Average (SMMA) over a user-defined period (e.g., 14 candles):
UVR=(UVR(Previous)×(Period−1)+Volatility Ratio)/Period
This calculation ensures UVR adapts dynamically to market conditions, focusing on significant price movements while filtering out noise.
 RSI FOR MOMENTUM DETECTION 
RSI (Relative Strength Index) identifies overbought and oversold conditions.
 Trend Confirmation at the 50 Level 
RSI values crossing above 50 signal the potential start of an upward trend.
RSI values crossing below 50 indicate the potential start of a downward trend.
 Key Reversals at Extreme Levels 
RSI detects trend reversals at overbought (>70) and oversold (<30) levels.
For example:
Overbought Trend Reversal: RSI >70 followed by bearish price action signals a potential downtrend.
Oversold Trend Reversal: RSI <30 with bullish confirmation signals a potential uptrend.
 Rare Extreme RSI Readings 
Extreme levels, such as RSI <12 (oversold) or RSI >88 (overbought), are used to identify rare yet powerful reversals.
 ---HOW IT DIFFERS FROM OTHER INDICATORS--- 
 Using UVR High and Low Values 
The Ultimate Volatility Rate (UVR) focuses on analyzing the high and low price ranges of the market to measure volatility.
Unlike traditional trend indicators that rely primarily on momentum or moving average crossovers, UVR leverages price extremes to better identify trend reversals.
This approach ensures fewer false signals during low-volatility phases and more accurate trend detection during high-volatility conditions.
 UVR as the Core Component 
The indicator is fundamentally built around UVR as the primary filter, while supporting tools like RSI (momentum detection), CMF (volume confirmation), and EMA (trend validation) complement its functionality.
By integrating these additional components, the indicator provides a multidimensional analysis rather than relying solely on a single approach.
 Dynamic Adaptation to Volatility 
UVR dynamically adjusts to market conditions, striving to improve filtering in low-volatility phases. While not flawless, this approach minimizes false signals and adapts more effectively to varying levels of market activity.
 Trend Clouds for Visual Guidance 
UVR-based dynamic clouds visually mark high and low price areas, highlighting potential consolidation or retracement zones.
These clouds serve as guides for setting stop-loss or take-profit levels, offering clear risk management strategies.
 BUY AND SELL SIGNAL LOGIC 
 BUY CONDITIONS 
 Momentum-Based Buy-Entry 
RSI >50, CMF >0, and the close price is above EMA50.
The price difference between open and close exceeds a threshold based on UVR.
Oversold Reversal
RSI <30 and CMF >0 with a strong bullish candle (close > open and UVR-based sensitivity filter).
 Breakout Confirmation 
The price breaks above a previously identified resistance, with conditions for RSI and CMF supporting the breakout.
 Reversal from Oversold RSI Extreme 
RSI <12 on the previous candle with a strong rebound on the current candle with UVR confirmation filter.
SELL CONDITIONS
 Momentum-Based Sell-Entry 
RSI <50, CMF <0, and the close price is below EMA50.
The price difference between open and close exceeds the UVR threshold.
 Overbought Reversal 
RSI >70 with bearish price action (open > close and UVR-based sensitivity filter).
 Breakdown Confirmation 
The price breaks below a previously identified support, with RSI and CMF supporting the breakdown.
 Reversal from Overbought RSI Extreme 
RSI >88 on the previous candle with a bearish confirmation on the current candle with UVR confirmation filter.
 BUY AND SELL SIGNALS VISUALIZATION 
The UVR Crypto Trend Indicator visually represents buy and sell conditions using dynamic plots, making it easier for traders to interpret and act on the signals. Below is an explanation of the visual representation:
 Buy Signals and Visualization 
 Signal Trigger: 
A buy signal is generated when one of the defined Buy Conditions is met (e.g., RSI >50, CMF >0, price above EMA50).
 Visual Representation: 
A blue upward arrow appears at the candle where the buy condition is triggered.
A blue cloud forms above the price candles, representing the strength of the bullish trend. The cloud dynamically adapts to market volatility, using the UVR calculation to mark support zones or consolidation levels.
 Purpose of the Blue Cloud: 
It acts as a visual guide for price movements and stay horizontal when the trend is not moving up
 Sell Signals and Visualization 
 Signal Trigger: 
A sell signal is generated when one of the defined Sell Conditions is met (e.g., RSI <50, CMF <0, price below EMA50).
 Visual Representation: 
A red downward arrow appears at the candle where the sell condition is triggered.
A red cloud forms below the price candles, representing the strength of the bearish trend. Like the blue cloud, it uses the UVR calculation to dynamically mark resistance zones or potential retracement levels.
 Purpose of the Red Cloud: 
It acts as a visual guide for price movements and stay horizontal when the trend is not moving down.
 CONCLUSION 
The UVR Crypto Trend indicator provides a powerful tool for trend reversal detection by combining volatility analysis, momentum confirmation, and trend-following techniques. Its unique use of the Ultimate Volatility Rate (UVR) as a core element, supported by proven indicators like RSI, CMF, and EMA, ensures reliable and actionable signals tailored for the crypto market's dynamic nature. By leveraging UVR’s high and low price range analysis, it achieves a level of precision that traditional indicators lack, making it a high-performing system for cryptocurrency traders.
Trading Sessions with Highs and LowsTrading Sessions with Highs and Lows  is designed to visually highlight specific trading sessions on the chart, providing traders with key insights into market behavior during these time periods. Here’s a detailed explanation of how the indicator works:
 Key Features 
1.	Session Boxes:
	•	The indicator plots colored boxes on the chart to represent the price range of defined trading sessions.
	•	Each box spans the session’s start and end times and encapsulates the high and low prices during that period.
	•	Two trading sessions are defined by default:
	•	USA Trading Session: 9:30 AM - 4:00 PM (New York Time).
	•	UK Trading Session: 8:00 AM - 4:30 PM (London Time).
2.	Session Labels:
	•	The name of the session (e.g., “USA” or “UK”) is displayed above the session box for clear identification.
3.	High and Low Markers:
	•	Markers are added to the chart at the session’s high and low points:
	•	High Marker: A green label indicating the session high.
	•	Low Marker: A red label indicating the session low.
4.	Dynamic Reset:
	•	After the session ends, the session high and low values are reset to na to prepare for the next trading day.
5.	Customizable Background Colors:
	•	Each session’s box has a distinct, semi-transparent background color for better visual separation.
 How It Works 
1.	Core Functionality:
	•	A function, plot_box, takes the session name, start time, end time, and background color as input.
	•	It calculates whether the current time is within the session.
	•	During the session:
	•	It tracks the session’s highest and lowest prices.
	•	It identifies the bars where the high and low occurred.
	•	At the session’s end:
	•	It plots a box on the chart covering the session’s time and price range.
	•	Labels are created for the session name and its high/low points.
2.	Session Timing:
	•	Timestamps for the USA and UK trading sessions are calculated using the timestamp function with respective time zones.
3.	Visual Elements:
	•	The box.new function draws the session boxes on the chart.
	•	The label.new function creates session name and high/low labels.
 Usage 
	•	Overlay Mode: The indicator is applied directly on the price chart (overlay=true), making it easy to visualize session-specific price behavior.
	•	Trading Strategy:
	•	Identify session-specific support and resistance levels.
	•	Observe price action trends during key trading periods.
	•	Align trading decisions with session dynamics.
 Customization 
While the indicator is preset for the USA and UK trading sessions, it can be easily modified:
	1.	Add/Remove Sessions: Define additional sessions by providing their start and end times.
	2.	Change Colors: Update the background_color in the plot_box calls to use different colors for sessions.
	3.	Adjust Time Zones: Replace the current time zones with others relevant to your trading style.
 Visualization Example 
	•	USA Session:
	•	Time: 9:30 AM - 4:00 PM (New York Time).
	•	Box Color: Semi-transparent orange.
	•	UK Session:
	•	Time: 8:00 AM - 4:30 PM (London Time).
	•	Box Color: Semi-transparent green.
 Why Use This Indicator? 
	1.	Market Awareness: Easily spot price behavior during high-liquidity trading periods.
	2.	Trend Analysis: Analyze how sessions overlap or affect each other.
	3.	Session Boundaries: Use session high/low levels as dynamic support and resistance zones.
This indicator is an essential tool for intraday and swing traders who want to align their strategies with key market timings.
Equal Highs and LowsDescription:
The ‘Equal Highs and Lows’ indicator is a technical analysis tool that marks identical price levels on a trading chart using the current time-frame, assisting traders in identifying potential support and resistance zones or liquidity draws. It creates a horizontal line connecting points where the price has created equal highs and lows within a specified lookback period. Unique to this tool, it maintains a clean chart by removing the line once the price surpasses the equal highs or falls below the equal lows, ensuring only the currently relevant equal highs and lows are highlighted.
Features:
Customization Options: Users can adjust the appearance of the lines (color, width, and style) to match their chart setup or preferences. Users can also choose to extend the lines marking the equal highs/lows to the right of the chart making the equal high/low levels more easier to visualize.
User-Defined Lookback Length: The number of bars to look back for finding equal highs and lows can be set by the user, allowing for flexibility in different market conditions.
How It Works:
The indicator meticulously scans the chart over a user-specified lookback duration, identifying bars with matching high or low values that have not been mitigated on the current chat timeframe, thereby constructing an index of equal values. It subsequently connects these equal values on the chart with a line. While this intuitive indicator does not forecast future market trends, it emphasizes significant price levels derived from historical data.
Usage:
Identifying Support and Resistance: The lines drawn by the indicator can be used to identify potential support and resistance zones and/or draws of liquidity, which are crucial for making informed trading decisions.
Strategy Development: Traders can incorporate the visual cues provided by the indicator into their trading strategies, using them as one of the factors for entry or exit decisions.
Originality:
This indicator presents a distinctive method for pinpointing and illustrating equal highs and lows, granting traders a crucial insight into key price levels. It stands apart from conventional indicators by offering extensive personalization and employing a novel approach to augment chart analysis. Uniquely, it retains only unmitigated equal high/low levels on the chart, automatically discarding mitigated price levels once the price has reached that level.
Conclusion:
The "Equal Highs and Lows" indicator is a practical tool for traders looking to enhance their chart analysis with visual cues of significant price levels. Its customization options and innovative approach make it a valuable addition to the trading toolkit, suitable for various trading styles and strategies.
Mxwll Price Action Suite [Mxwll]Introducing the Mxwll Price Action Suite!
The Mxwll Price Action Suite is an all-in-one analysis indicator incorporating elements of SMC and also ideas extending beyond the trading methodology!
 Features 
 
 Internal structures
 External structures
 Customizable Sensitivities 
 BoS/CHoCH
 Order Blocks
 HH/LH/LL/LH Areas 
 Rolling TF highs/lows
 Rolling Volume Comparisons
 Auto Fibs
 And more!
 
  
The image above shows the indicator's market structure identification capabilities. Internal BoS and CHoCH structures in addition to overarching market structures are available with customizable sensitivities.
  
The image above shows the indicator identifying order blocks! Additionally, HH/LH/LL/LH areas are also identified.
  
The image above shows a rolling area of interest. These areas can be compared to supply/demand zones, where traders might consider a bargain long/short/sell area. 
  
The indicator displays a rolling 4hr high/low and 1D high/low, alongside auto fibonacci levels with a customizable sensitivity. 
  
Finally, the Mxwll Price Action Suite shows relevant session information.
 Table information 
 
 Current Session
 Countdown to session close
 Next Session
 Countdown to next session open
 Rolling 4-Hr volume intensity
 Rolling 24-Hr volume intensity
 
Introducing the Mxwll SMC Suite!
The Mxwll SMC Suite is an all-in-one analysis indicator incorporating elements of SMC and also ideas extending beyond the trading methodology!
 Features 
 
 Internal structures
 External structures
 Customizable Sensitivities 
 BoS/CHoCH
 Order Blocks
 HH/LH/LL/LH Areas 
 Rolling TF highs/lows
 Rolling Volume Comparisons
 Auto Fibs
 And more!
 
  
The image above shows the indicator's market structure identification capabilities. Internal BoS and CHoCH structures in addition to overarching market structures are available with customizable sensitivities.
  
The image above shows the indicator identifying order blocks! Additionally, HH/LH/LL/LH areas are also identified.
  
The image above shows a rolling area of interest. These areas can be compared to supply/demand zones, where traders might consider a bargain long/short/sell area. 
  
The indicator displays a rolling 4hr high/low and 1D high/low, alongside auto fibonacci levels with a customizable sensitivity. 
  
Finally, the Mxwll Price Action Suite shows relevant session information.
 Table information 
 
 Current Session
 Countdown to session close
 Next Session
 Countdown to next session open
 Rolling 4-Hr volume intensity
 Rolling 24-Hr volume intensity
 
 Expanded Features of Mxwll Price Action Suite 
 Internal and External Structures 
Internal Structures: These elements refer to the price formations and patterns that occur within a smaller scope or a specific trading session. The suite can detect intricate details like minor support/resistance levels or short-term trend reversals.
External Structures: These involve larger, more significant market patterns and trends spanning multiple sessions or time frames. This capability helps traders understand overarching market directions.
 Customizable Sensitivities 
Adjusting sensitivity settings allows users to tailor the indicator's responsiveness to market changes. Higher sensitivity can catch smaller fluctuations, while lower sensitivity might focus on more significant, reliable market moves.
 Break of Structure (BoS) and Change of Character (CHoCH) 
BoS: This feature identifies points where the price breaks a significant structure, potentially indicating a new trend or a trend reversal.
CHoCH: Detects subtle shifts in the market's behavior, which could suggest the early stages of a trend change before they become apparent to the broader market.
 Order Blocks and Market Phases 
Order Blocks: These are essentially price levels or zones where significant trading activities previously occurred, likely pointing to the positions of smart money.
HH/LH/LL/LH Areas: Identifying Higher Highs (HH), Lower Highs (LH), Lower Lows (LL), and Lower Highs (LH) helps in understanding the trend and market structure, aiding in predictive analysis.
 Rolling Timeframe Highs/Lows and Volume Comparisons 
Tracks highs and lows over specified rolling periods, providing dynamic support and resistance levels.
Compares volume data across different timeframes to assess the strength or weakness of the current price movements.
 Auto Fibonacci Levels 
Automatically calculates and plots Fibonacci retracement levels, a popular tool among traders to identify potential reversal points based on past movements.
 Session Data and Volume Intensity 
Session Information: Displays current and upcoming trading sessions along with countdown timers, which is crucial for day traders and those trading on session overlaps.
Volume Intensity: Measures and compares the volume within the last 4 hours and 24 hours to gauge market activity and potential breakout/breakdown movements.
 Visualizations and Practical Use 
Dynamic Visuals: The suite provides dynamic visual aids, such as real-time updating of high/low markers and Fibonacci levels, which adjust as new data comes in. This feature is critical in fast-paced markets.
Strategic Entry/Exit Points: By identifying order blocks and using Fibonacci levels, traders can pinpoint strategic entry and exit points, maximizing potential returns.
Risk Management: Enhanced features like session countdowns and volume intensity help in better risk management by providing traders with more data on market sentiment and potential volatility.
Fib Pivot Points HLThis TradingView indicator allows users to select a specific timeframe (TF) and then analyzes the high, low, and closing prices from the past period within that TF to calculate a central pivot point. The pivot point is determined using the formula (High + Close + Low) / 3, providing a key level around which the market is expected to pivot or change direction.
In addition to the central pivot point, the indicator enhances its utility by incorporating Fibonacci levels. These levels are calculated based on the range from the low to the high of the selected timeframe. For instance, a Fibonacci level like R0.38 would be calculated by adding 38% of the high-low range to the pivot point, giving traders potential resistance levels above the pivot.
Key features of this indicator include:
 Timeframe Selection:  Users can choose their desired timeframe, such as weekly, daily, etc., for analysis.
 Pivot Point Calculation:  The indicator calculates the pivot point based on the previous period's high, low, and closing prices within the selected timeframe.
 Fibonacci Levels:  Adds Fibonacci retracement levels to the pivot point, offering traders additional layers of potential support and resistance based on the natural Fibonacci sequence.
This indicator is particularly useful for traders looking to identify potential turning points in the market and key levels of support and resistance based on historical price action and the Fibonacci sequence, which is widely regarded for its ability to predict market movements.
 Example:  
Suppose you're analyzing the EUR/USD currency pair using this indicator with a weekly timeframe setting. The previous week's price action showed a high of 1.2100, a low of 1.1900, and the week closed at 1.2000.
Using the formula ( High + Close + Low ) / 3 (High+Close+Low)/3, the pivot point would be calculated as ( 1.2100 + 1.2000 + 1.1900 ) / 3 = 1.2000. Thus, the central pivot point for the current week is at 1.2000.
The range from the low to the high is 1.2100 − 1.1900 = 0.0200 1.2100−1.1900=0.0200.
To calculate a specific Fibonacci level, such as R0.38, you would add 38% of the high-low range to the pivot point: 1.2000 + ( 0.0200 ∗ 0.38 ) = 1.2076 1.2000+(0.0200∗0.38)=1.2076. Thus, the R0.38 Fibonacci resistance level is at 1.2076. 
Similarly, you can calculate other Fibonacci levels such as S0.38 (Support level at 38% retracement) by subtracting 38% of the high-low range from the pivot point.
Traders can use the pivot point as a reference for the market's directional bias: prices above the pivot point suggest bullish sentiment, while prices below indicate bearish sentiment. The Fibonacci levels act as potential stepping stones for price movements, offering strategic points for entry, exit, or placing stop-loss orders.
Fake BreakoutThis indicator detect fake breakout on previous day high/low and option previous swing high and low
Rule Detect Fake Breakout  On Previous Day High/Low Or  Swing high low Fake Breakout -
1) Detect previous day high/low or swing high/low
2)
    A) If price revisit on previous day high/swing high look for upside breakout after input                            
        number of candle (1-5) price came back to previous high and breakout happen downside   
        it show sell because its fake breakout of previous day  high or swing high
          
     B) If price revisit on previous day low/swing low look for downside breakout after input                            
        number of candle (1-5) price came back to previous low and breakout upside of previous    
        day low  it show Buy because its fake breakout of previous day low or swing low
          
Disclaimer -Traders can use this script as a starting point for further customization or as a reference for developing their own trading strategies. It's important to note that past performance is not indicative of future results, and thorough testing and validation are recommended before deploying any trading strategy. 
  
Ticker Correlation Reference IndicatorHello,
I am super excited to be releasing this Ticker Correlation assessment indicator. This is a big one so let us get right into it! 
 Inspiration: 
The inspiration for this indicator came from a similar indicator by Balipour called the Correlation with P-Value and Confidence Interval. It’s a great indicator, you should check it out! 
I used it quite a lot when looking for correlations; however, there were some limitations to this indicator’s functionality that I wanted. So I decided to make my own indicator that had the functionality I wanted. I have been using this for some time but decided to actual spruce it up a bit and make it user friendly so that I could share it publically. So let me get into what this indicator does and, most importantly, the expanded functionality of this indicator. 
 What it does: 
This indicator determines the correlation between 2 separate tickers. The user selects the two tickers they wish to compare and it performs a correlation assessment over a defaulted 14 period length and displays the results. However, the indicator takes this much further. The complete functionality of this indicator includes the following:
1.	Assesses the correlation of all 4 ticker variables (Open, High, Low and Close) over a user defined period of time (defaulted to 14); 
2.	Converts both tickers to a Z-Score in order to standardize the data and provide a side by side comparison;  
3.	Displays areas of high and low correlation between all 4 variables; 
4.	Looks back over the consistency of the relationship (is correlation consistent among the two tickers or infrequent?); 
5.	Displays the variance in the correlation (there may be a statistically significant relationship, but if there is a high variance, it means the relationship is unstable); 
6.	Permits manual conversion between prices; and 
7.	Determines the degree of statistical significance (be it stable, unstable or non-existent). 
I will discuss each of these functions below. 
 Function 1: Assesses the correlation of all 4 variables. 
 
The only other indicator that does this only determines the correlation of the close price. However, correlation between all 4 variables varies. The correlation between open prices, high prices, low prices and close prices varies in statistically significant ways. As such, this indicator plots the correlation of all 4 ticker variables and displays each correlation. 
Assessing this matters because sometimes a stock may not have the same magnitude in highs and lows as another stock (one stock may be more bullish, i.e. attain higher highs in comparison to another stock). Close price is helpful but does not pain the full picture. As such, the indicator displays the correlation relationship between all 4 variables (image below):
  
 Function 2: Converts both tickers to Z-Score 
Z-Score is a way of standardizing data. It simply measures how far a stock is trading in relation to its mean. As such, it is a way to express both tickers on a level playing field. Z-Score was also chosen because the Z-Score Values (0 – 4) also provide an appropriate scale to plot correlation lines (which range from 0 to 1). 
The primary ticker (Ticker 1) is plotted in blue, the secondary comparison ticker (Ticker 2) is plotted in a colour changing format (which will be discussed below). See the image below:
   
 Function 3: Displays areas of high and low correlation 
While Ticker 1 is plotted in a static blue, Ticker 2 (the comparison ticker) is plotted in a dynamic, colour changing format. It will display areas of high correlation (i.e. areas with a P value greater than or equal to 0.9 or less than and equal to -0.9) in green, areas of moderate correlation in white. Areas of low correlation (between 0.4 and 0 or -0.4 and 0) are in red. (see image below):
   
 Function 4: Checks consistency of relationship  
While at the time of assessing a stock there very well maybe a high correlation, whether that correlation is consistent or not is the question. The indicator employs the use of the SMA function to plot the average correlation over a defined period of time. If the correlation is consistently high, the SMA should be within an area of statistical significance (over 0.5 or under -0.5). If the relationship is inconsistent, the SMA will read a lower value than the actual correlation. 
You can see an example of this when you compare ETH to Tezos in the image below:
   
You can see that the correlation between ETH and Tezo’s on the high level seems to be inconsistent. While the current correlation is significant, the SMA is showing that the average correlation between the highs is actually less than 0.5. 
The indicator also tells the user narratively the degree of consistency in the statistical relationship. This will be discussed later.
 Function 5: Displays the variance 
When it comes to correlation, variance is important. Variance simply means the distance between the highest and lowest value. The indicator assess the variance. A high degree of variance (i.e. a number surpassing 0.5 or greater) generally means the consistency and stability of the relationship is in issue. If there is a high variance, it means that the two tickers, while seemingly significantly correlated, tend to deviate from each other quite extensively.
The indicator will tell the user the variance in the narrative bar at the bottom of the chart (see image below):
   
 Function 6: Permits manual conversion of price 
One thing that I frequently want and like to do is convert prices between tickers. If I am looking at SPX and I want to calculate a price on SPY, I want to be able to do that quickly. This indicator permits you to do that by employing a regression based formula to convert Ticker 1 to Ticker 2. 
The user can actually input which variable they would like to convert, whether they want to convert Ticker 1 Close to Ticker 2 Close, or Ticker 1 High to Ticker 2 High, or low or open. 
To do this, open the settings and click “Permit Manual Conversion”. This will then take the current Ticker 1 Close price and convert it to Ticker 2 based on the regression calculations. 
If you want to know what a specific price on Ticker 1 is on Ticker 2, simply click the “Allow Manual Price Input” variable and type in the price of Ticker 1 you want to know on Ticker 2. It will perform the calculation for you and will also list the standard error of the calculation. 
Below is an example of calculating a SPY price using SPX data:
  
Above, the indicator was asked to convert an SPX price of 4,100 to a SPY price. The result was 408.83 with a standard error of 4.31, meaning we can expect 4,100 to fall within 408.83 +/- 4.31 on SPY. 
 Function 7: Determines the degree of statistical significance  
The indicator will provide the user with a narrative output of the degree of statistical significance. The indicator looks beyond simply what the correlation is at the time of the assessment. It uses the SMA and the highest and lowest function to make an assessment of the stability of the statistical relationship and then indicates this to the user. Below is an example of IWM compared to SPY:
   
You will see, the indicator indicates that, while there is a statistically significant positive relationship, the relationship is somewhat unstable and inconsistent. Not only does it tell you this, but it indicates the degree of inconsistencies by listing the variance and the range of the inconsistencies. 
And below is SPY to DIA:
  
SPY to BTCUSD:
   
And finally SPY to USDCAD Currency:
   
 Other functions: 
The indicator will also plot the raw or smoothed correlation result for the Open, High, Low or Close price. The default is to close price and smoothed. Smoothed just means it is displaying the SMA over the raw correlation score. Unsmoothing it will show you the raw correlation score. 
The user also has the ability to toggle on and off the correlation table and the narrative table so that they can just review the chart (the side by side comparison of the 2 tickers). 
 Customizability 
All of the functions are customizable for the most part. The user can determine the length of lookback, etc. The default parameters for all are 14. The only thing not customizable is the assessment used for determining the stability of a statistical relationship (set at 100 candle lookback) and the regression analysis used to convert price (10 candle lookback). 
 User Notes and important application tips: 
#1: If using the manual calculation function to convert price, it is recommended to use this on the hourly or daily chart. 
#2: Leaving pre-market data on can cause some errors. It is recommended to use the indicator with regular market hours enabled and extended market hours disabled. 
#3: No ticker is off limits. You can compare anything against anything! Have fun with it and experiment! 
 Non-Indicator Specific Discussions:  
 Why does correlation between stocks mater?  
This can matter for a number of reasons. For investors, it is good to diversify your portfolio and have a good array of stocks that operate somewhat independently of each other. This will allow you to see how your investments compare to each other and the degree of the relationship.
Another function may be getting exposure to more expensive tickers. I am guilty of trading IWM to gain exposure to SPY at a reduced cost basis :-). 
 What is a statistically significant correlation?  
The rule of thumb is anything 0.5 or greater is considered statistically significant. The ideal setup is 0.9 or more as the effect is almost identical. That said, a lot of factors play into statistical significance. For example, the consistency and variance are 2 important factors most do not consider when ascertaining significance. Perhaps IWM and SPY are significantly correlated today, but is that a reliable relationship and can that be counted on as a rule? 
These are things that should be considered when trading one ticker against another and these are things that I have attempted to address with this indicator! 
Final notes:
I know I usually do tutorial videos. I have not done one here, but I will. Check back later for this.
I hope you enjoy the indicator and please feel free to share your thoughts and suggestions! 
Safe trades all! 
NSDT Lattice WebThis script creates a "web" by connecting different points of candles. All configurable by the trader.
There are 4 basic parts to a candle:
Open, High, Low, and Close
With this script, you can connect any point of one candle in the past to any point of another current candle.
For example:
High to High, High to Low, High to Open, High to close
Low to High, Low to Low, Low to Open, Low to Close
Open to High, Open to Low, Open to Open, Open to Close
Close to High, Close to Low, Close to Open, Close to Close
The script will change the line colors based on whether the current plot is higher or lower than the previous plot.
Try out different connection points to see what works for you. Connecting High to High and Low to Low, might easily show you when the market is making higher highs or lower lows, indicating a potential movement.
Run it on replay at a higher speed and see how it may potentially help identify area of congestion or trends.
VisibleChart█   OVERVIEW 
This library is a Pine programmer’s tool containing functions that return values calculated from the range of visible bars on the chart.
This is now possible in Pine Script™ thanks to the recently-released  chart.left_visible_bar_time  and  chart.right_visible_bar_time  built-ins, which return the opening  time  of the leftmost and rightmost bars on the chart. These values update as traders scroll or zoom their charts, which gives way to a class of indicators that can dynamically recalculate and draw visuals on visible bars only, as users scroll or zoom their charts. We hope this library's functions help you make the most of the world of possibilities these new built-ins provide for Pine scripts.
For an example of a script using this library, have a look at the  Chart VWAP  indicator.
█   CONCEPTS 
 Chart properties 
The new  chart.left_visible_bar_time  and  chart.right_visible_bar_time  variables return the opening  time  of the leftmost and rightmost bars on the chart. They are only two of many new built-ins in the `chart.*` namespace. See  this blog post  for more information, or look them up by typing "chart." in the  Pine Script™ Reference Manual .
 Dynamic recalculation of scripts on visible bars 
Any script using  chart.left_visible_bar_time  or  chart.right_visible_bar_time  acquires a unique property, which triggers its recalculation when traders scroll or zoom their charts in such a way that the range of visible bars on the chart changes. This library's functions use the two recent built-ins to derive various values from the range of visible bars.
 Designing your scripts for dynamic recalculation  
 For the library's functions to work correctly, they must be called on every bar.  For reliable results, assign their results to global variables and then use the variables locally where needed — not the raw function calls.
Some functions like `barIsVisible()` or `open()` will return a value starting on the leftmost visible bar. Others such as `high()` or `low()` will also return a value starting on the leftmost visible bar, but their correct value can only be known on the rightmost visible bar, after all visible bars have been analyzed by the script.
You can plot values as the script executes on visible bars, but efficient code will, when possible, create resource-intensive labels, lines or tables only once in the global scope using  var , and then use the setter functions to modify their properties on the last bar only. The example code included in this library uses this method.
Keep in mind that when your script uses  chart.left_visible_bar_time  or  chart.right_visible_bar_time , your script will recalculate on all bars each time the user scrolls or zooms their chart. To provide script users with the best experience you should strive to keep calculations to a minimum and use efficient code so that traders are not always waiting for your script to recalculate every time they scroll or zoom their chart.
Another aspect to consider is the fact that the rightmost visible bar will not always be the last bar in the dataset. When script users scroll back in time, a large portion of the time series the script calculates on may be situated after the rightmost visible bar. We can never assume the rightmost visible bar is also the last bar of the time series. Use  `barIsVisible()`  to restrict calculations to visible bars, but also consider that your script can continue to execute past them.
 Look first. Then leap.  
█   FUNCTIONS 
The library contains the following functions:
 barIsVisible() 
  Condition to determine if a given bar is within the users visible time range.
  Returns: (bool) True if the the calling bar is between the `chart.left_visible_bar_time` and the `chart.right_visible_bar_time`.
 high() 
  Determines the value of the highest `high` in visible bars.
  Returns: (float) The maximum high value of visible chart bars.
 highBarIndex() 
  Determines the `bar_index` of the highest `high` in visible bars.
  Returns: (int) The `bar_index` of the `high()`.
 highBarTime() 
  Determines the bar time of the highest `high` in visible bars.
  Returns: (int) The `time` of the `high()`.
 low() 
  Determines the value of the lowest `low` in visible bars.
  Returns: (float) The minimum low value of visible chart bars.
 lowBarIndex() 
  Determines the `bar_index` of the lowest `low` in visible bars.
  Returns: (int) The `bar_index` of the `low()`.
 lowBarTime() 
  Determines the bar time of the lowest `low` in visible bars.
  Returns: (int) The `time` of the `low()`.
 open() 
  Determines the value of the opening price in the visible chart time range.
  Returns: (float) The `open` of the leftmost visible chart bar.
 close() 
  Determines the value of the closing price in the visible chart time range.
  Returns: (float) The `close` of the rightmost visible chart bar.
 leftBarIndex() 
  Determines the `bar_index` of the leftmost visible chart bar.
  Returns: (int) A `bar_index`.
 rightBarIndex() 
  Determines the `bar_index` of the rightmost visible chart bar.
  Returns: (int) A `bar_index`
 bars() 
  Determines the number of visible chart bars.
  Returns: (int) The number of bars.
 volume() 
  Determines the sum of volume of all visible chart bars.
  Returns: (float) The cumulative sum of volume.
 ohlcv() 
  Determines the open, high, low, close, and volume sum of the visible bar time range.
  Returns: ( ) A tuple of the OHLCV values for the visible chart bars. Example: open is chart left, high is the highest visible high, etc.
 chartYPct(pct) 
  Determines a price level as a percentage of the visible bar price range, which depends on the chart's top/bottom margins in "Settings/Appearance".
  Parameters:
     pct : (series float) Percentage of the visible price range (50 is 50%). Negative values are allowed.
  Returns: (float) A price level equal to the `pct` of the price range between the high and low of visible chart bars. Example: 50 is halfway between the visible high and low.
 chartXTimePct(pct) 
  Determines a time as a percentage of the visible bar time range.
  Parameters:
     pct : (series float) Percentage of the visible time range (50 is 50%). Negative values are allowed.
  Returns: (float) A time in UNIX format equal to the `pct` of the time range from the `chart.left_visible_bar_time` to the `chart.right_visible_bar_time`. Example: 50 is halfway from the leftmost visible bar to the rightmost.
 chartXIndexPct(pct) 
  Determines a `bar_index` as a percentage of the visible bar time range.
  Parameters:
     pct : (series float) Percentage of the visible time range (50 is 50%). Negative values are allowed.
  Returns: (float) A time in UNIX format equal to the `pct` of the time range from the `chart.left_visible_bar_time` to the `chart.right_visible_bar_time`. Example: 50 is halfway from the leftmost visible bar to the rightmost.
 whenVisible(src, whenCond, length) 
  Creates an array containing the `length` last `src` values where `whenCond` is true for visible chart bars.
  Parameters:
     src : (series int/float) The source of the values to be included. 
     whenCond : (series bool) The condition determining which values are included. Optional. The default is `true`.
     length : (simple int) The number of last values to return. Optional. The default is all values.
  Returns: (float ) The array ID of the accumulated `src` values.
 avg(src) 
  Gathers values of the source over visible chart bars and averages them.
  Parameters:
     src : (series int/float) The source of the values to be averaged. Optional. Default is `close`. 
  Returns: (float) A cumulative average of values for the visible time range.
 median(src) 
  Calculates the median of a source over visible chart bars.
  Parameters:
     src : (series int/float) The source of the values. Optional. Default is `close`.
  Returns: (float) The median of the `src` for the visible time range.
 vVwap(src) 
  Calculates a volume-weighted average for visible chart bars.
  Parameters:
     src : (series int/float) Source used for the VWAP calculation. Optional. Default is `hlc3`.
  Returns: (float) The VWAP for the visible time range.
Price Action Brooks ProPrice Action Brooks Pro (PABP) - Professional Trading Indicator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 OVERVIEW
Price Action Brooks Pro (PABP) is a professional-grade TradingView indicator developed based on Al Brooks' Price Action trading methodology. It integrates decades of Al Brooks' trading experience and price action analysis techniques into a comprehensive technical analysis tool, helping traders accurately interpret market structure and identify trading opportunities.
• Applicable Markets: Stocks, Futures, Forex, Cryptocurrencies
• Timeframes: 1-minute to Daily (5-minute chart recommended)
• Theoretical Foundation: Al Brooks Price Action Trading Method
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 CORE FEATURES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1️⃣ INTELLIGENT GAP DETECTION SYSTEM
Automatically identifies and marks three critical types of gaps in the market.
TRADITIONAL GAP
• Detects complete price gaps between bars
• Upward gap: Current bar's low > Previous bar's high
• Downward gap: Current bar's high < Previous bar's low
• Hollow border design - doesn't obscure price action
• Color coding: Upward gaps (light green), Downward gaps (light pink)
• Adjustable border: 1-5 pixel width options
TAIL GAP
• Detects price gaps between bar wicks/shadows
• Analyzes across 3 bars for precision
• Identifies hidden market structure
BODY GAP
• Focuses only on gaps between bar bodies (open/close)
• Filters out wick noise
• Disabled by default, enable as needed
Trading Significance:
• Gaps signal strong momentum
• Gap fills provide trading opportunities
• Consecutive gaps indicate trend continuation
✓ Independent alert system for all gap types
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2️⃣ RTH BAR COUNT (Trading Session Counter)
Intelligent counting system designed for US stock intraday trading.
FEATURES
• RTH Only Display: Regular Trading Hours (09:30-15:00 EST)
• 5-Minute Chart Optimized: Displays every 3 bars (15-minute intervals)
• Daily Auto-Reset: Counting starts from 1 each trading day
SMART COLOR CODING
• 🔴 Red (Bars 18 & 48): Critical turning moments (1.5h & 4h)
• 🔵 Sky Blue (Multiples of 12): Hourly markers (12, 24, 36...)
• 🟢 Light Green (Bar 6): Half-hour marker (30 minutes)
• ⚫ Gray (Others): Regular 15-minute interval markers
Al Brooks Time Theory:
• Bar 18 (90 min): First 90 minutes determine daily trend
• Bar 48 (4 hours): Important afternoon turning point
• Hourly markers: Track institutional trading rhythm
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3️⃣ FOUR-LINE EMA SYSTEM
Professional-grade configurable moving average system.
DEFAULT CONFIGURATION
• EMA 20: Short-term trend (Al Brooks' most important MA)
• EMA 50: Medium-short term reference
• EMA 100: Medium-long term confirmation
• EMA 200: Long-term trend and bull/bear dividing line
FLEXIBLE CUSTOMIZATION
Each EMA can be independently configured:
• On/Off toggle
• Data source selection (close/high/low/open, etc.)
• Custom period length
• Offset adjustment
• Color and transparency
COLOR SCHEME
• EMA 20: Dark brown, opaque (most important)
• EMA 50/100/200: Blue-purple gradient, 70% transparent
TRADING APPLICATIONS
• Bullish Alignment: Price > 20 > 50 > 100 > 200
• Bearish Alignment: 200 > 100 > 50 > 20 > Price
• EMA Confluence: All within <1% = major move precursor
Al Brooks Quote:
"The EMA 20 is the most important moving average. Almost all trading decisions should reference it."
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4️⃣ PREVIOUS VALUES (Key Prior Price Levels)
Automatically marks important price levels that often act as support/resistance.
THREE INDEPENDENT CONFIGURATIONS
Each group configurable for:
• Timeframe (1D/60min/15min, etc.)
• Price source (close/high/low/open/CurrentOpen, etc.)
• Line style and color
• Display duration (Today/TimeFrame/All)
SMART OPEN PRICE LABELS ⭐
• Auto-displays "Open" label when CurrentOpen selected
• Label color matches line color
• Customizable label size
TYPICAL SETUP
• 1st Line: Previous close (Support/Resistance)
• 2nd Line: Previous high (Breakout target)
• 3rd Line: Previous low (Support level)
Al Brooks Magnet Price Theory:
• Previous open: Price frequently tests opening price
• Previous high/low: Strongest support/resistance
• Breakout confirmation: Breaking prior levels = trend continuation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5️⃣ INSIDE & OUTSIDE BAR PATTERN RECOGNITION
Automatically detects core candlestick patterns from Al Brooks' theory.
ii PATTERN (Consecutive Inside Bars)
• Current bar contained within previous bar
• Two or more consecutive
• Labels: ii, iii, iiii (auto-accumulates)
• High-probability breakout setup
• Stop loss: Outside both bars
Trading Significance:
"Inside bars are one of the most reliable breakout setups, especially three or more consecutive inside bars." - Al Brooks
OO PATTERN (Consecutive Outside Bars)
• Current bar engulfs previous bar
• Two or more consecutive
• Labels: oo, ooo (auto-accumulates)
• Indicates indecision or volatility increase
ioi PATTERN (Inside-Outside-Inside)
• Three-bar combination: Inside → Outside → Inside
• Auto-detected and labeled
• Tug-of-war pattern
• Breakout direction often very strong
SMART LABEL SYSTEM
• Auto-accumulation counting
• Dynamic label updates
• Customizable size and color
• Positioned above bars
✓ Independent alerts for all patterns
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 USE CASES
INTRADAY TRADING
✓ Bar Count (timing rhythm)
✓ Traditional Gap (strong signals)
✓ EMA 20 + 50 (quick trend)
✓ ii/ioi Patterns (breakout points)
SWING TRADING
✓ Previous Values (key levels)
✓ EMA 20 + 50 + 100 (trend analysis)
✓ Gaps (trend confirmation)
✓ iii Patterns (entry timing)
TREND FOLLOWING
✓ All four EMAs (alignment analysis)
✓ Gaps (continuation signals)
✓ Previous Values (targets)
BREAKOUT TRADING
✓ iii Pattern (high-reliability setup)
✓ Previous Values (targets)
✓ EMA 20 (trend direction)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 DESIGN FEATURES
PROFESSIONAL COLOR SCHEME
• Gaps: Hollow borders + light colors
• Bar Count: Smart multi-color coding
• EMAs: Gradient colors + transparency hierarchy
• Previous Values: Customizable + smart labels
CLEAR VISUAL HIERARCHY
• Important elements: Opaque (EMA 20, bar count)
• Reference elements: Semi-transparent (other EMAs, gaps)
• Hollow design: Doesn't obscure price action
USER-FRIENDLY INTERFACE
• Clear functional grouping
• Inline layout saves space
• All colors and sizes customizable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 AL BROOKS THEORY CORE
READING PRICE ACTION
"Don't try to predict the market, read what the market is telling you."
PABP converts core concepts into visual tools:
• Trend Assessment: EMA system
• Time Rhythm: Bar Count
• Market Structure: Gap analysis
• Trade Setups: Inside/Outside Bars
• Support/Resistance: Previous Values
PROBABILITY THINKING
• ii pattern: Medium probability
• iii pattern: High probability
• iii + EMA 20 support: Very high probability
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ TECHNICAL SPECIFICATIONS
• Pine Script Version: v6
• Maximum Objects: 500 lines, 500 labels, 500 boxes
• Alert Functions: 8 independent alerts
• Supported Timeframes: All (5-min recommended for Bar Count)
• Compatibility: All TradingView plans, Mobile & Desktop
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 RECOMMENDED INITIAL SETTINGS
GAPS
• Traditional Gap: ✓
• Tail Gap: ✓
• Border Width: 2
BAR COUNT
• Use Bar Count: ✓
• Label Size: Normal
EMA
• EMA 20: ✓
• EMA 50: ✓
• EMA 100: ✓
• EMA 200: ✓
PREVIOUS VALUES
• 1st: close (Previous close)
• 2nd: high (Previous high)
• 3rd: low (Previous low)
INSIDE & OUTSIDE BAR
• All patterns: ✓
• Label Size: Large
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌟 WHY CHOOSE PABP?
✅ Solid Theoretical Foundation
Based on Al Brooks' decades of trading experience
✅ Complete Professional Features
Systematizes complex price action analysis
✅ Highly Customizable
Every feature adjustable to personal style
✅ Excellent Performance
Optimized code ensures smooth experience
✅ Continuous Updates
Constantly improving based on feedback
✅ Suitable for All Levels
Benefits beginners to professionals
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 RECOMMENDED LEARNING
Al Brooks Books:
• "Trading Price Action Trends"
• "Trading Price Action Trading Ranges"
• "Trading Price Action Reversals"
Learning Path:
1. Understand basic candlestick patterns
2. Learn EMA applications
3. Master market structure analysis
4. Develop trading system
5. Continuous practice and optimization
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ RISK DISCLOSURE
IMPORTANT NOTICE:
• For educational and informational purposes only
• Does not constitute investment advice
• Past performance doesn't guarantee future results
• Trading involves risk and may result in capital loss
• Trade according to your risk tolerance
• Test thoroughly in demo account first
RESPONSIBLE TRADING:
• Always use stop losses
• Control position sizes reasonably
• Don't overtrade
• Continuous learning and improvement
• Keep trading journal
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📜 COPYRIGHT
Price Action Brooks Pro (PABP)
Author: © JimmC98
License: Mozilla Public License 2.0
Pine Script Version: v6
Acknowledgments:
Thanks to Dr. Al Brooks for his contributions to price action trading. This indicator is developed based on his theories.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Experience professional-grade price action analysis now!
"The best traders read price action, not indicators. But when indicators help you read price action better, use them." - Al Brooks
Liquidity Grab + RSI Divergence═══════════════════════════════════════════════════════════════
LIQUIDITY GRAB + RSI DIVERGENCE INDICATOR
═══════════════════════════════════════════════════════════════
📌 OVERVIEW
This indicator identifies high-probability reversals by combining:
  • Liquidity sweeps (stop hunts)
  • RSI divergence confirmation
  • Filters false breakouts automatically
═══════════════════════════════════════════════════════════════
🟢 BUY SIGNAL (Green Triangle Up)
REQUIRES BOTH CONDITIONS:
1. Liquidity Grab Below Previous Low
   • Price breaks BELOW recent low
   • Candle CLOSES ABOVE that low
   • Traps sellers who shorted the breakdown
2. Bullish RSI Divergence
   • Price: Lower Low (LL)
   • RSI: Higher Low (HL)
   • Shows weakening downward momentum
➜ Result: Potential bullish reversal
═══════════════════════════════════════════════════════════════
🔴 SELL SIGNAL (Red Triangle Down)
REQUIRES BOTH CONDITIONS:
1. Liquidity Grab Above Previous High
   • Price breaks ABOVE recent high
   • Candle CLOSES BELOW that high
   • Traps buyers who bought the breakout
2. Bearish RSI Divergence
   • Price: Higher High (HH)
   • RSI: Lower High (LH)
   • Shows weakening upward momentum
➜ Result: Potential bearish reversal
═══════════════════════════════════════════════════════════════
📊 VISUAL INDICATORS
Main Signals:
  🔺 Large Green Triangle = BUY (Liq Grab + Bullish Div)
  🔻 Large Red Triangle = SELL (Liq Grab + Bearish Div)
Reference Levels:
  ━ Red Line = Previous High Level
  ━ Green Line = Previous Low Level
Additional Markers (Optional):
  ○ Small Green Circle = Liquidity grab low only
  ○ Small Red Circle = Liquidity grab high only
  ✕ Small Blue Cross = Bullish divergence only
  ✕ Small Orange Cross = Bearish divergence only
═══════════════════════════════════════════════════════════════
⚙️ SETTINGS
1. Lookback Period (Default: 20)
   • Range: 5-100
   • Sets how far back to identify previous highs/lows
   • Higher = fewer but stronger levels
   • Lower = more frequent but weaker levels
2. RSI Length (Default: 14)
   • Range: 5-50
   • Standard RSI calculation period
   • 14 is industry standard
3. RSI Divergence Lookback (Default: 5)
   • Range: 3-20
   • Controls pivot point sensitivity
   • Higher = fewer divergence signals
   • Lower = more divergence signals
4. Show Labels (Default: ON)
   • Toggle BUY/SELL text labels
   • Disable for cleaner chart view
═══════════════════════════════════════════════════════════════
💡 HOW TO USE
Step 1: WAIT FOR CONFIRMATION
  • Only trade LARGE TRIANGLE signals
  • Ignore small circles/crosses alone
Step 2: CHECK TIMEFRAME
  • Best on: 15min, 1H, 4H, Daily
  • Avoid: 1min, 5min (too noisy)
Step 3: CONFIRM CONTEXT
  • Check overall market trend
  • Identify key support/resistance
  • Look for confluence with price action
Step 4: ENTRY & RISK MANAGEMENT
  • Enter on signal candle close or pullback
  • Stop loss below/above the liquidity grab wick
  • Target: Previous swing high/low or key levels
  • Risk/Reward: Minimum 1:2 ratio
Step 5: SET ALERTS
  • Create alert for "BUY Signal"
  • Create alert for "SELL Signal"
  • Never miss opportunities
═══════════════════════════════════════════════════════════════
✅ BEST PRACTICES
DO:
  ✓ Use on multiple timeframes for confluence
  ✓ Combine with support/resistance zones
  ✓ Wait for both conditions (liq grab + divergence)
  ✓ Practice on demo account first
  ✓ Use proper position sizing
DON'T:
  ✗ Trade every small circle/cross
  ✗ Use on very low timeframes (<15min)
  ✗ Ignore overall market context
  ✗ Trade without stop loss
  ✗ Risk more than 1-2% per trade
═══════════════════════════════════════════════════════════════
⚠️ IMPORTANT NOTES
• This is a CONFIRMATION tool, not a holy grail
• No indicator is 100% accurate
• Combine with your trading strategy
• Backtest on your preferred instruments
• Adjust parameters for your trading style
• Higher timeframes = more reliable signals
• Always use risk management
═══════════════════════════════════════════════════════════════
🔔 ALERTS INCLUDED
Two alert conditions are built-in:
  1. "BUY Signal" - Liquidity Grab + Bullish RSI Divergence
  2. "SELL Signal" - Liquidity Grab + Bearish RSI Divergence
═══════════════════════════════════════════════════════════════
📈 RECOMMENDED SETTINGS BY TIMEFRAME
5-15 Min Charts:
  • Lookback: 10-15
  • RSI Length: 14
  • RSI Div Lookback: 3-5
1H-4H Charts:
  • Lookback: 20-30
  • RSI Length: 14
  • RSI Div Lookback: 5-7
Daily Charts:
  • Lookback: 30-50
  • RSI Length: 14
  • RSI Div Lookback: 7-10
═══════════════════════════════════════════════════════════════
Good luck and trade safe! 🚀
Aynet- True Wick Projector for Non-Standard ChartsTechnical Explanation: "Data Projection and Synchronization"
This script is, at its core, a "data projection" tool. The fundamental technical problem it solves is compensating for the information loss that occurs when using different data visualization models.
1. The Core Problem: Information Loss
Standard Charts (Time-Based): Normal candlesticks are time-based. Each candle represents a fixed time interval (like 1 hour or 1 day) and displays the complete Open, High, Low, and Close (OHLC) data for that period. The "wicks" show the volatility and the extreme price points (the High and Low).
Non-Standard Charts (Price/Momentum-Based): Charts like Kagi, Renko, or Line Break filter out time. Their only concern is price movement. While one Renko box or Kagi line is forming, 10 or more time-based candles might have formed in the background. During this "noise filtering" process, the true high and low values (the wicks) from those underlying candles are lost.
The problem is this: A trader looking at a non-standard chart cannot see how high or low the price actually went while that block or line was forming. This is a critical loss of information regarding market volatility, support/resistance levels, and price rejection.
2. The Technical Solution: A "Dual Data Stream"
This script intelligently combines two different data streams to compensate for this information loss:
Main Stream (Current Chart): The open and close data from your active Kagi, Renko, etc., chart.
Secondary Stream (Projected Data): The high and low data from the underlying standard (time-based) chart.
3. The Code's Methodical Steps
Step 1: Identifying the Data Source (syminfo...)
This step precisely identifies the source for the secondary data stream. By using syminfo.prefix + ":" + syminfo.ticker (e.g., "NASDAQ:AAPL"), it guarantees that the data is pulled from the exact correct instrument and exchange.
Step 2: Data Request & "Lookahead" Synchronization (request.security)
This is the most critical part of the operation.
request.security(...): This is the function Pine Script uses to pull data from another dataset (the secondary stream) onto the current chart.
 : This tells the function, "The only data I care about is the 'High' and 'Low' of the standard candle from that timeframe."
lookahead = barmerge.lookahead_on (The Critical Key): This command solves the "time paradox."
Normally (without this): request.security fetches data from the last completed bar. But as your Kagi bar is currently forming, the standard candle is also currently forming. This would cause the data to always be one bar behind (lag).
With lookahead_on: This permits the script to "look ahead" at the data from the currently forming, incomplete standard bar. Because of this, as your Kagi bar moves, the true wick data is updated in real-time. This achieves real-time synchronization.
Step 3: Visual Engineering (plotcandle)
After the script retrieves the data, it must "draw" it. However, it only wants to draw the wicks, not the candle bodies.
bodyTop and bodyBottom: First, it finds the top and bottom of the current Kagi bar's body (using math.max(open, close)).
Plotting the Upper Wick (Green):
It calls the plotcandle function and instructs it to draw a fake candle.
It fixes this fake candle's Open, Low, and Close (open, low, close) values to the top of the Kagi bar's body (bodyTop).
It only sets the High (high) value to the realHigh it fetched with request.security.
The result: A wick is drawn from the bodyTop level up to the realHigh level, with no visible body.
Plotting the Lower Wick (Red):
It applies the reverse logic.
It fixes the fake candle's Open, High, and Close values to the bottom of the Kagi bar's body (bodyBottom).
It only sets the Low (low) value to the realLow.
The result: A lower wick is drawn from bodyBottom down to realLow.
Invisibility (color.new(color.white, 100)):
In both plotcandle calls, the color (body color) and bordercolor are set to 100 transparency. This makes the "fake" candle bodies completely invisible, leaving only the colored wicks.
Conclusion (Technical Summary)
This script reclaims the volatility data (the wicks) that is naturally sacrificed by non-standard charts.
It achieves this with technical precision by creating a secondary data stream using request.security and synchronizing it with zero lag using the lookahead_on parameter.
Finally, it intelligently manipulates the plotcandle function (by creating invisible bodies) to project this lost data onto your Kagi/Renko chart as an "augmented reality" layer. This allows a trader to benefit from the clean, noise-filtered view of a non-standard chart without losing access to the full picture of market volatility.
Hidden Impulse═══════════════════════════════════════════════════════════════════
HIDDEN IMPULSE - Multi-Timeframe Momentum Detection System
═══════════════════════════════════════════════════════════════════
OVERVIEW
Hidden Impulse is an advanced momentum oscillator that combines the Schaff Trend Cycle (STC) and Force Index into a comprehensive multi-timeframe trading system. Unlike standard implementations of these indicators, this script introduces three distinct trading setups with specific entry conditions, multi-timeframe confirmation, and trend filtering.
═══════════════════════════════════════════════════════════════════
ORIGINALITY & KEY FEATURES
This indicator is original in the following ways:
1. DUAL-TIMEFRAME STC ANALYSIS
   Standard STC implementations work on a single timeframe. This script 
   simultaneously analyzes STC on both your trading timeframe and a higher 
   timeframe, providing trend context and filtering out low-probability signals.
2. FORCE INDEX INTEGRATION
   The script combines STC with Force Index (volume-weighted price momentum) 
   to confirm the strength behind price moves. This combination helps identify 
   when momentum shifts are backed by genuine buying/selling pressure.
3. THREE DISTINCT TRADING SETUPS
   Rather than generic overbought/oversold signals, the indicator provides 
   three specific, rule-based setups:
   - Setup A: Classic trend-following entries with multi-timeframe confirmation
   - Setup B: Divergence-based reversal entries (highest probability)
   - Setup C: Mean-reversion bounce trades at extreme levels
4. INTELLIGENT FILTERING
   All signals are filtered through:
   - 50 EMA trend direction (prevents counter-trend trades)
   - Higher timeframe STC alignment (ensures macro trend agreement)
   - Force Index confirmation (validates volume support)
═══════════════════════════════════════════════════════════════════
HOW IT WORKS - TECHNICAL EXPLANATION
SCHAFF TREND CYCLE (STC) CALCULATION:
The STC is a cyclical oscillator that combines MACD concepts with stochastic 
smoothing to create earlier and smoother trend signals.
Step 1: Calculate MACD
   - Fast MA = EMA(close, Length1) — default 23
   - Slow MA = EMA(close, Length2) — default 50
   - MACD Line = Fast MA - Slow MA
Step 2: First Stochastic Smoothing
   - Apply stochastic calculation to MACD
   - Stoch1 = 100 × (MACD - Lowest(MACD, Smoothing)) / (Highest(MACD, Smoothing) - Lowest(MACD, Smoothing))
   - Smooth result with EMA(Stoch1, Smoothing) — default 10
Step 3: Second Stochastic Smoothing
   - Apply stochastic calculation again to the smoothed stochastic
   - This creates the final STC value between 0-100
The dual stochastic smoothing makes STC more responsive than MACD while 
being smoother than traditional stochastics.
FORCE INDEX CALCULATION:
Force Index measures the power behind price movements by incorporating volume:
   Force Raw = (Close - Close ) × Volume
   Force Index = EMA(Force Raw, Period) — default 13
Interpretation:
   - Positive Force Index = Buying pressure (bulls in control)
   - Negative Force Index = Selling pressure (bears in control)
   - Force Index crossing zero = Momentum shift
   - Divergences with price = Weakening momentum (reversal signal)
TREND FILTER:
A 50-period EMA serves as the trend filter:
   - Price above EMA50 = Uptrend → Only LONG signals allowed
   - Price below EMA50 = Downtrend → Only SHORT signals allowed
This prevents counter-trend trading which accounts for most losing trades.
═══════════════════════════════════════════════════════════════════
THE THREE TRADING SETUPS - DETAILED
SETUP A: CLASSIC MOMENTUM ENTRY
Concept: Enter when STC exits oversold/overbought zones with trend confirmation
LONG CONDITIONS:
   1. Higher timeframe STC > 25 (macro trend is up)
   2. Primary timeframe STC crosses above 25 (momentum turning up)
   3. Force Index crosses above 0 OR already positive (volume confirms)
   4. Price above 50 EMA (local trend is up)
SHORT CONDITIONS:
   1. Higher timeframe STC < 75 (macro trend is down)
   2. Primary timeframe STC crosses below 75 (momentum turning down)
   3. Force Index crosses below 0 OR already negative (volume confirms)
   4. Price below 50 EMA (local trend is down)
Best for: Trending markets, continuation trades
Win rate: Moderate (60-65%)
Risk/Reward: 1:2 to 1:3
───────────────────────────────────────────────────────────────────
SETUP B: DIVERGENCE REVERSAL (HIGHEST PROBABILITY)
Concept: Identify exhaustion points where price makes new extremes but 
momentum (Force Index) fails to confirm
BULLISH DIVERGENCE:
   1. Price makes a lower low (LL) over 10 bars
   2. Force Index makes a higher low (HL) — refuses to follow price down
   3. STC is below 25 (oversold condition)
   
   Trigger: STC starts rising AND Force Index crosses above zero
BEARISH DIVERGENCE:
   1. Price makes a higher high (HH) over 10 bars
   2. Force Index makes a lower high (LH) — refuses to follow price up
   3. STC is above 75 (overbought condition)
   
   Trigger: STC starts falling AND Force Index crosses below zero
Why this works: Divergences signal that the current trend is losing steam. 
When volume (Force Index) doesn't confirm new price extremes, a reversal 
is likely.
Best for: Reversal trading, range-bound markets
Win rate: High (70-75%)
Risk/Reward: 1:3 to 1:5
───────────────────────────────────────────────────────────────────
SETUP C: QUICK BOUNCE AT EXTREMES
Concept: Catch rapid mean-reversion moves when price touches EMA50 in 
extreme STC zones
LONG CONDITIONS:
   1. Price touches 50 EMA from above (pullback in uptrend)
   2. STC < 15 (extreme oversold)
   3. Force Index > 0 (buyers stepping in)
SHORT CONDITIONS:
   1. Price touches 50 EMA from below (pullback in downtrend)
   2. STC > 85 (extreme overbought)
   3. Force Index < 0 (sellers stepping in)
Best for: Scalping, quick mean-reversion trades
Win rate: Moderate (55-60%)
Risk/Reward: 1:1 to 1:2
Note: Use tighter stops and quick profit-taking
═══════════════════════════════════════════════════════════════════
HOW TO USE THE INDICATOR
STEP 1: CONFIGURE TIMEFRAMES
Primary Timeframe (STC - Primary Timeframe):
   - Leave empty to use your current chart timeframe
   - This is where you'll take trades
Higher Timeframe (STC - Higher Timeframe):
   - Default: 30 minutes
   - Recommended ratios:
     * 5min chart → 30min higher TF
     * 15min chart → 1H higher TF
     * 1H chart → 4H higher TF
     * Daily chart → Weekly higher TF
───────────────────────────────────────────────────────────────────
STEP 2: ADJUST STC PARAMETERS FOR YOUR MARKET
Default (23/50/10) works well for stocks and forex, but adjust for:
CRYPTO (volatile):
   - Length 1: 15
   - Length 2: 35
   - Smoothing: 8
   (Faster response for rapid price movements)
STOCKS (standard):
   - Length 1: 23
   - Length 2: 50
   - Smoothing: 10
   (Balanced settings)
FOREX MAJORS (slower):
   - Length 1: 30
   - Length 2: 60
   - Smoothing: 12
   (Filters out noise in 24/7 markets)
───────────────────────────────────────────────────────────────────
STEP 3: ENABLE YOUR PREFERRED SETUPS
Toggle setups based on your trading style:
Conservative Trader:
   ✓ Setup B (Divergence) — highest win rate
   ✗ Setup A (Classic) — only in strong trends
   ✗ Setup C (Bounce) — too aggressive
Trend Trader:
   ✓ Setup A (Classic) — primary signals
   ✓ Setup B (Divergence) — for entries on pullbacks
   ✗ Setup C (Bounce) — not suitable for trending
Scalper:
   ✓ Setup C (Bounce) — quick in-and-out
   ✓ Setup B (Divergence) — high probability scalps
   ✗ Setup A (Classic) — too slow
───────────────────────────────────────────────────────────────────
STEP 4: READ THE SIGNALS
ON THE CHART:
   Labels appear when conditions are met:
   
   Green labels:
   - "LONG A" — Setup A long entry
   - "LONG B DIV" — Setup B divergence long (best signal)
   - "LONG C" — Setup C bounce long
   
   Red labels:
   - "SHORT A" — Setup A short entry
   - "SHORT B DIV" — Setup B divergence short (best signal)
   - "SHORT C" — Setup C bounce short
IN THE INDICATOR PANEL (bottom):
   - Blue line = Primary timeframe STC
   - Orange dots = Higher timeframe STC (optional)
   - Green/Red bars = Force Index histogram
   - Dashed lines at 25/75 = Entry/Exit zones
   - Background shading = Oversold (green) / Overbought (red)
INFO TABLE (top-right corner):
   Shows real-time status:
   - STC values for both timeframes
   - Force Index direction
   - Price position vs EMA
   - Current trend direction
   - Active signal type
═══════════════════════════════════════════════════════════════════
TRADING STRATEGY & RISK MANAGEMENT
ENTRY RULES:
Priority ranking (best to worst):
   1st: Setup B (Divergence) — wait for these
   2nd: Setup A (Classic) — in confirmed trends only
   3rd: Setup C (Bounce) — scalping only
Confirmation checklist before entry:
   ☑ Signal label appears on chart
   ☑ TREND in info table matches signal direction
   ☑ Higher timeframe STC aligned (check orange dots or table)
   ☑ Force Index confirming (check histogram color)
───────────────────────────────────────────────────────────────────
STOP LOSS PLACEMENT:
Setup A (Classic):
   - LONG: Below recent swing low
   - SHORT: Above recent swing high
   - Typical: 1-2 ATR distance
Setup B (Divergence):
   - LONG: Below the divergence low
   - SHORT: Above the divergence high
   - Typical: 0.5-1.5 ATR distance
Setup C (Bounce):
   - LONG: 5-10 pips below EMA50
   - SHORT: 5-10 pips above EMA50
   - Typical: 0.3-0.8 ATR distance
───────────────────────────────────────────────────────────────────
TAKE PROFIT TARGETS:
Conservative approach:
   - Exit when STC reaches opposite level
   - LONG: Exit when STC > 75
   - SHORT: Exit when STC < 25
Aggressive approach:
   - Hold until opposite signal appears
   - Trail stop as STC moves in your favor
Partial profits:
   - Take 50% at 1:2 risk/reward
   - Let remaining 50% run to target
───────────────────────────────────────────────────────────────────
WHAT TO AVOID:
❌ Trading Setup A in sideways/choppy markets
   → Wait for clear trend or use Setup B only
❌ Ignoring higher timeframe STC
   → Always check orange dots align with your direction
❌ Taking signals against the major trend
   → If weekly trend is down, be cautious with longs
❌ Overtrading Setup C
   → Maximum 2-3 bounce trades per session
❌ Trading during low volume periods
   → Force Index becomes unreliable
═══════════════════════════════════════════════════════════════════
ALERTS CONFIGURATION
The indicator includes 8 alert types:
Individual setup alerts:
   - "Setup A - LONG" / "Setup A - SHORT"
   - "Setup B - DIV LONG" / "Setup B - DIV SHORT" ⭐ recommended
   - "Setup C - BOUNCE LONG" / "Setup C - BOUNCE SHORT"
Combined alerts:
   - "ANY LONG" — fires on any long signal
   - "ANY SHORT" — fires on any short signal
Recommended alert setup:
   - Create "Setup B - DIV LONG" and "Setup B - DIV SHORT" alerts
   - These are the highest probability signals
   - Set "Once Per Bar Close" to avoid false alerts
═══════════════════════════════════════════════════════════════════
VISUALIZATION SETTINGS
Show Labels on Chart:
   Toggle on/off the signal labels (green/red)
   Disable for cleaner chart once you're familiar with the indicator
Show Higher TF STC:
   Toggle the orange dots showing higher timeframe STC
   Useful for visual confirmation of multi-timeframe alignment
Info Panel:
   Cannot be disabled — always shows current status
   Positioned top-right to avoid chart interference
═══════════════════════════════════════════════════════════════════
EXAMPLE TRADE WALKTHROUGH
SETUP B DIVERGENCE LONG EXAMPLE:
1. Market Context:
   - Price in downtrend, below 50 EMA
   - Multiple lower lows forming
   - STC below 25 (oversold)
2. Divergence Formation:
   - Price makes new low at $45.20
   - Force Index refuses to make new low (higher low forms)
   - This indicates selling pressure weakening
3. Signal Trigger:
   - STC starts turning up
   - Force Index crosses above zero
   - Label appears: "LONG B DIV"
4. Trade Execution:
   - Entry: $45.50 (current price at signal)
   - Stop Loss: $44.80 (below divergence low)
   - Target 1: $47.90 (STC reaches 75) — risk/reward 1:3.4
   - Target 2: Opposite signal or trail stop
5. Trade Management:
   - Price rallies to $47.20
   - STC reaches 68 (approaching target zone)
   - Take 50% profit, move stop to breakeven
   - Exit remaining at $48.10 when STC crosses 75
Result: 3.7R gain
═══════════════════════════════════════════════════════════════════
ADVANCED TIPS
1. MULTI-TIMEFRAME CONFLUENCE
   For highest probability trades, wait for:
   - Primary TF signal
   - Higher TF STC aligned (>25 for longs, <75 for shorts)
   - Even higher TF trend in same direction (manual check)
2. VOLUME CONFIRMATION
   Watch the Force Index histogram:
   - Increasing bar size = Strengthening momentum
   - Decreasing bar size = Weakening momentum
   - Use this to gauge signal strength
3. AVOID THESE MARKET CONDITIONS
   - Major news events (Force Index becomes erratic)
   - Market open first 30 minutes (volatility spikes)
   - Low liquidity instruments (Force Index unreliable)
   - Extreme trending days (wait for pullbacks)
4. COMBINE WITH SUPPORT/RESISTANCE
   Best signals occur near:
   - Key horizontal levels
   - Fibonacci retracements
   - Previous day's high/low
   - Psychological round numbers
5. SESSION AWARENESS
   - Asia session: Use lower timeframes, Setup C works well
   - London session: Setup A and B both effective
   - New York session: All setups work, highest volume
═══════════════════════════════════════════════════════════════════
INDICATOR WINDOWS LAYOUT
MAIN CHART:
   - Price action
   - 50 EMA (green/red)
   - Signal labels
   - Info panel
INDICATOR WINDOW:
   - STC oscillator (blue line, 0-100 scale)
   - Higher TF STC (orange dots, optional)
   - Force Index histogram (green/red bars)
   - Reference levels (25, 50, 75)
   - Background zones (green oversold, red overbought)
═══════════════════════════════════════════════════════════════════
PERFORMANCE OPTIMIZATION
For best results:
Backtesting:
   - Test on your specific instrument and timeframe
   - Adjust STC parameters if win rate < 55%
   - Record which setup works best for your market
Position Sizing:
   - Risk 1-2% per trade
   - Setup B can use 2% risk (higher win rate)
   - Setup C should use 1% risk (lower win rate)
Trade Frequency:
   - Setup B: 2-5 signals per week (be patient)
   - Setup A: 5-10 signals per week
   - Setup C: 10+ signals per week (scalping)
═══════════════════════════════════════════════════════════════════
CREDITS & REFERENCES
This indicator builds upon established technical analysis concepts:
Schaff Trend Cycle:
   - Developed by Doug Schaff (1996)
   - Original concept published in Technical Analysis of Stocks & Commodities
   - Implementation based on standard STC formula
Force Index:
   - Developed by Dr. Alexander Elder
   - Described in "Trading for a Living" (1993)
   - Classic volume-momentum indicator
The multi-timeframe integration, three-setup system, and specific 
entry conditions are original contributions of this indicator.
═══════════════════════════════════════════════════════════════════
DISCLAIMER
This indicator is a technical analysis tool and does not guarantee profits. 
Past performance is not indicative of future results. Always:
   - Use proper risk management
   - Test on demo account first
   - Combine with fundamental analysis
   - Never risk more than you can afford to lose
═══════════════════════════════════════════════════════════════════
SUPPORT & QUESTIONS
If you find this indicator helpful, please:
   - Leave a like and comment
   - Share your feedback and results
   - Report any bugs or issues
For questions about usage or optimization for specific markets, 
feel free to comment below.
═════════════════════════════════════════════════════════════
Pivot Trend Flow [BigBeluga]🔵 OVERVIEW 
 Pivot Trend Flow   turns raw swing points into a clean, adaptive trend band. It averages recent pivot highs and lows to form two dynamic reference levels; when price crosses above the averaged highs, trend flips  bullish  and a  green  band is drawn; when it crosses below the averaged lows, trend flips  bearish  and a  red  band is drawn. During an uptrend the script highlights  breakouts of previous pivot highs  with ▲ labels, and during a downtrend it flags  breakdowns of previous pivot lows  with ▼ labels—making structure shifts and continuation signals obvious.
 🔵 CONCEPTS 
 
   Pivot-Based Averages : Recent pivot highs/lows are collected and averaged to create smoothed upper/lower reference levels.
 
if not na(ph)
    phArray.push(ph)
if not na(pl)
    plArray.push(pl)
if phArray.size() > avgWindow
    upper := phArray.avg()
    phArray.shift()
if plArray.size() > avgWindow
    lower := plArray.avg()
    plArray.shift()
 
  
   Trend State via Crosses : Close above the averaged-highs ⇒ bullish trend; close below the averaged-lows ⇒ bearish trend.
   Trend Band : A colored band (green/red) is plotted and optionally filled to visualize the active regime around price.
  
   Structure Triggers : 
In bull mode the tool watches for prior pivot-high breakouts (▲). 
  
In bear mode it watches for prior pivot-low breakdowns (▼).
  
 
 🔵 FEATURES 
 
   Adaptive Trend Detection  from averaged pivot highs/lows.
   Clear Visuals : Green band in uptrends, red band in downtrends; optional fill for quick read.
   Breakout/Breakdown Labels :
 
  ▲ marks breaks of previous pivot highs in uptrends
  ▼ marks breaks of previous pivot lows in downtrends
 
   Minimal Clutter : Uses compact lines and labels that extend only on confirmation.
   Customizable Colors & Fill  for trend states and band styling.
 
 🔵 HOW TO USE 
 
   Pivot Length : Sets how swing points are detected. Smaller = more reactive; larger = smoother.
   Avg Window (pivots) : How many recent pivot highs/lows are averaged. Increase to stabilize the band; decrease for agility.
   Read the Band :
 
  Green band active ⇒ prioritize longs, pullback buys toward the band.
  Red band active ⇒ prioritize shorts, pullback sells toward the band.
 
   Trade the Triggers :
 
  In bull mode, ▲ on a prior pivot-high break can confirm continuation.
  In bear mode, ▼ on a prior pivot-low break can confirm continuation.
 
   Combine with Context : Use HTF trend, S/R, or volume for confluence and to filter signals.
   Fill Color Toggle : Enable/disable band fill to match your chart style.
 
 🔵 CONCLUSION 
 Pivot Trend Flow   converts swing structure into an actionable, low-lag trend framework. By blending averaged pivots with clean breakout/breakdown labels, it clarifies trend direction, timing, and continuation spots—ideal as a core bias tool or a confirmation layer in any trading system.
Trend Fib Zone Bounce (TFZB) [KedArc Quant]Description:
Trend Fib Zone Bounce (TFZB) trades with the latest confirmed Supply/Demand zone using a single, configurable Fib pullback (0.3/0.5/0.6). Trade only in the direction of the most recent zone and use a single, configurable fib level for pullback entries.
	•	Detects market structure via confirmed swing highs/lows using a rolling window.
	•	Draws Supply/Demand zones (bearish/bullish rectangles) from the latest MSS (CHOCH or BOS) event.
	•	Computes intra zone Fib guide rails and keeps them extended in real time.
	•	Triggers BUY only inside bullish zones and SELL only inside bearish zones when price touches the selected fib and closes back beyond it (bounce confirmation).
	•	Optional labels print BULL/BEAR + fib next to the triangle markers.
	
What it does 
	Finds structure using confirmed swing highs/lows (you choose the confirmation length).
	Builds the latest zone (bullish = demand, bearish = supply) after a CHOCH/BOS event.
	Draws intra-zone “guide rails” (Fib lines) and extends them live.
	Signals only with the trend of that zone:
	BUY inside a bullish zone when price tags the selected Fib and closes back above it.
	SELL inside a bearish zone when price tags the selected Fib and closes back below it.
	Optional labels print BULL/BEAR + Fib next to triangles for quick context
	
Why this is different 
	Most “zone + fib + signal” tools bolt together several indicators, or fire counter-trend signals because they don’t fully respect structure. TFZB is intentionally minimal:
	Single bias source: the latest confirmed zone defines direction; nothing else overrides it.
	Single entry rule: one Fib bounce (0.3/0.5/0.6 selectable) inside that zone—no counter-trend trades by design.
	Clean visuals: you can show only the most recent zone, clamp overlap, and keep just the rails that matter.
	Deterministic & transparent: every plot/label comes from the code you see—no external series or hidden smoothing
	
How it helps traders
	Cuts decision noise: you always know the bias and the only entry that matters right now.
	Forces discipline: if price isn’t inside the active zone, you don’t trade.
	Adapts to volatility: pick 0.3 in strong trends, 0.5 as the default, 0.6 in chop.
	Non-repainting zones: swings are confirmed after Structure Length bars, then used to build zones that extend forward (they don’t “teleport” later)
	
How it works (details)
*Structure confirmation
	A swing high/low is only confirmed after Structure Length bars have elapsed; the dot is plotted back on the original bar using offset. Expect a confirmation delay of about Structure Length × timeframe. 
*Zone creation
	After a CHOCH/BOS (momentum shift / break of prior swing), TFZB draws the new Supply/Demand zone from the swing anchors and sets it active. 
*Fib guide rails
	Inside the active zone TFZB projects up to five Fib lines (defaults: 0.3 / 0.5 / 0.7) and extends them as time passes. 
*Entry logic (with-trend only)
	BUY: bar’s low ≤ fib and close > fib inside a bullish zone.
	SELL: bar’s high ≥ fib and close < fib inside a bearish zone.
*Optionally restrict to one signal per zone to avoid over-trading. 
(Optional) Aggressive confirm-bar entry
When do the swing dots print?
	* The code confirms a swing only after `structureLen` bars have elapsed since that candidate high/low.
	* On a 5-min chart with `structureLen = 10`, that’s about 50 minutes later.
	* When the swing confirms, the script plots the dot back on the original bar (via `offset = -structureLen`). So you *see* the dot on the old bar, but it only appears on the chart once the confirming bar arrives.
	> Practical takeaway: expect swing markers to appear roughly `structureLen × timeframe` later. Zones and signals are built from those confirmed swings.
Best timeframe for this Indicator
Use the timeframe that matches your holding period and the noise level of the instrument:
* Intraday :
  * 5m or 15m are the sweet spots.
  * Suggested `structureLen`:
    * 5m: 10–14 (confirmation delay \~50–70 min)
    * 15m: 8–10 (confirmation delay \~2–2.5 hours)
  * Keep Entry Fib at 0.5 to start; try 0.3 in strong trends, 0.6 in chop.
  * Tip: avoid the first 10–15 minutes after the open; let the initial volatility set the early structure.
* Swing/overnight:
  * 1h or 4h.
  * `structureLen`:
    * 1h: 6–10 (6–10 hours confirmation)
    * 4h: 5–8  (20–32 hours confirmation)
* 1m scalping: not recommended here—the confirmation lag relative to the noise makes zones less reliable.
Inputs (all groups)
Structure
	•	Show Swing Points (structureTog)
		o	Plots small dots on the bar where a swing point is confirmed (offset back by Structure Length).
	•	Structure Length (structureLen)
		o	Lookback used to confirm swing highs/lows and determine local structure. Higher = fewer, stronger swings; lower = more reactive.
	Zones
	•	Show Last (zoneDispNum)
		o	Maximum number of zones kept on the chart when Display All Zones is off.
	•	Display All Zones (dispAll)
		o	If on, ignores Show Last and keeps all zones/levels.
	•	Zone Display (zoneFilter): Bullish Only / Bearish Only / Both
		o	Filters which zone types are drawn and eligible for signals.
	•	Clean Up Level Overlap (noOverlap)
		o	Prevents fib lines from overlapping when a new zone starts near the previous one (clamps line start/end times for readability).
Fib Levels
Each row controls whether a fib is drawn and how it looks:
	•	Toggle (f1Tog…f5Tog): Show/hide a given fib line.
	•	Level (f1Lvl…f5Lvl): Numeric ratio in  . Defaults active: 0.3, 0.5, 0.7 (0 and 1 off by default).
	•	Line Style (f1Style…f5Style): Solid / Dashed / Dotted.
	•	Bull/Bear Colors (f#BullColor, f#BearColor): Per-fib color in bullish vs bearish zones.
Style
	•	Structure Color: Dot color for confirmed swing points.
	•	Bullish Zone Color / Bearish Zone Color: Rectangle fills (transparent by default).
Signals
	•	Entry Fib for Signals (entryFibSel): Choose 0.3, 0.5 (default), or 0.6 as the trigger line.
	•	Show Buy/Sell Signals (showSignals): Toggles triangle markers on/off.
	•	One Signal Per Zone (oneSignalPerZone): If on, suppresses additional entries within the same zone after the first trigger.
	•	Show Signal Text Labels (Bull/Bear + Fib) (showSignalLabels): Adds a small label next to each triangle showing zone bias and the fib used (e.g., BULL 0.5 or BEAR 0.3).
How TFZB decides signals
With trend only:
	•	BUY
		1.	Latest active zone is bullish.
		2.	Current bar’s close is inside the zone (between top and bottom).
		3.	The bar’s low ≤ selected fib and it closes > selected fib (bounce).
	•	SELL
		1.	Latest active zone is bearish.
		2.	Current bar’s close is inside the zone.
		3.	The bar’s high ≥ selected fib and it closes < selected fib.
Markers & labels
	•	BUY: triangle up below the bar; optional label “BULL 0.x” above it.
	•	SELL: triangle down above the bar; optional label “BEAR 0.x” below it.
Right-Panel Swing Log (Table)
What it is
	A compact, auto-updating log of the most recent Swing High/Low events, printed in the top-right of the chart. 
	It helps you see when a pivot formed, when it was confirmed, and at what price—so you know the earliest bar a zone-based signal could have appeared.
Columns
	Type – Swing High or Swing Low.
	Date – Calendar date of the swing bar (follows the chart’s timezone).
	Swing @ – Time of the original swing bar (where the dot is drawn).
	Confirm @ – Time of the bar that confirmed that swing (≈ Structure Length × timeframe after the swing). This is also the earliest moment a new zone/entry can be considered.
	Price – The swing price (high for SH, low for SL).
Why it’s useful
	Clarity on repaint/confirmation: shows the natural delay between a swing forming and being usable—no guessing.
	Planning & journaling: quick reference of today’s pivots and prices for notes/backtesting.
	Scanning intraday: glance to see if you already have a confirmed zone (and therefore valid fib-bounce entries), or if you’re still waiting.
	Context for signals: if a fib-bounce triangle appears before the time listed in Confirm @, it’s not a valid trade (you were too early).
	Settings (Inputs → Logging)
	Log swing times / Show table – turn the table on/off.
	Rows to keep – how many recent entries to display.
	Show labels on swing bar – optional tags on the chart (“Swing High 11:45”, “Confirm SH 14:15”) that match the table.
Recommended defaults
•	Structure Length: 10–20 for intraday; 20–40 for swing.
•	Entry Fib for Signals: 0.5 to start; try 0.3 in stronger trends and 0.6 in choppier markets.
•	One Signal Per Zone: ON (prevents over trading).
•	Zone Display: Both.
•	Fib Lines: Keep 0.3/0.5/0.7 on; turn on 0 and 1 only if you need anchors.
Alerts
	Two alert conditions are available:
		•	BUY signal – fires when a with trend bullish bounce at the selected fib occurs inside a bullish zone.
		•	SELL signal – fires when a with trend bearish bounce at the selected fib occurs inside a bearish zone.
	Create alerts from the chart’s Alerts panel and select the desired condition. Use Once Per Bar Close to avoid intrabar flicker.
Notes & tips
	•	Swing dots are confirmed only after Structure Length bars, so they plot back in time; zones built from these confirmed swings do not repaint (though they extend as new bars form).
	•	If you don’t see a BUY where you expect one, check: (1) Is the active zone bullish? (2) Did the candle’s low actually pierce the selected fib and close above it? (3) Is One Signal Per Zone suppressing a second entry?
	•	You can hide visual clutter by reducing Show Last to 1–3 while keeping Display All Zones off.
Glossary
	•	CHOCH (Change of Character): A shift where price breaks beyond the last opposite swing while local momentum flips.
	•	BOS (Break of Structure): A cleaner break beyond the prior swing level in the current momentum direction.
	•	MSS: Either CHOCH or BOS – any event that spawns a new zone.
Extension ideas (optional)
	•	Add fib extensions (1.272 / 1.618) for target lines.
	•	Zone quality score using ATR normalization to filter weak impulses.
	•	HTF filter to only accept zones aligned with a higher timeframe trend.
 
⚠️ Disclaimer This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.
Monday's Range Superpowerkyu🔔 Settings
You can customize the colors and toggle ON/OFF in the indicator settings.
Works on daily, hourly, and minute charts.
Easily visualize Monday’s high, low, and mid-line range.
📌 1. Support & Resistance with Monday’s Range
Monday High: Acts as the first resistance of the week.
◽ Example: If price breaks above Monday’s high after Tuesday, it signals potential bullish continuation → long setup.
Monday Low: Acts as the first support of the week.
◽ Example: If price breaks below Monday’s low, it signals bearish continuation → short setup.
📌 2. Mid-Line Trend Confirmation
Monday Mid-Line = average price of Monday.
Price above mid-line → bullish bias.
Price below mid-line → bearish bias.
Use mid-line breaks as entry confirmation for long/short positions.
📌 3. Breakout Strategy
Break of Monday’s High = bullish breakout → long entry.
Break of Monday’s Low = bearish breakout → short entry.
Place stop-loss inside Monday’s range for a conservative approach.
📌 4. False Breakout Strategy
If price breaks Monday’s high/low but then falls back inside Monday’s range, it is a False Breakout.
Strategy: Trade in the opposite direction.
◽ False Breakout at High → short.
◽ False Breakout at Low → long.
Stop-loss at the wick (extreme point) of the failed breakout.
📌 5. Range-Based Scalping
Use Monday’s high and low as a trading range.
Sell near Monday’s High, buy near Monday’s Low, repeat until breakout occurs.
📌 6. Weekly Volatility Forecast
Narrow Monday range → higher chance of strong trend later in the week.
Wide Monday range → lower volatility expected during the week.
📌 7. Pattern & Trend Analysis within Monday Range
Look for candlestick patterns around Monday’s High/Low/Mid-Line.
◽ Example: Double Top near Monday’s High = short setup.
◽ Repeated bounce at Mid-Line = strong long opportunity.
✅ Summary
The Monday’s Range (Superpowerkyu) Indicator helps traders:
Identify weekly support & resistance
Confirm trend direction with Mid-Line
Trade breakouts & false breakouts
Apply range scalping strategies
Forecast weekly volatility
⚡ Especially, the False Breakout strategy is powerful as it captures failed moves and sudden sentiment reversals.
Yelober - Market Internal direction+ Key levelsYelober – Market Internals + Key Levels is a focused intraday trading tool that helps you spot high-probability price direction by anchoring decisions to structure that matters: yesterday’s RTH High/Low, today’s pre-market High/Low, and a fast Value Area/POC from the prior session. Paired with a compact market internals dashboard (NYSE/NASDAQ UVOL vs. DVOL ratios, VOLD slopes, TICK/TICKQ momentum, and optional VIX trend), it gives you a real-time read on breadth so you can choose which direction to trade, when to enter (breaks, retests, or fades at PMH/PML/VAH/VAL/POC), and how to plan exits as internals confirm or deteriorate. On top of these intraday decision benefits, it also allows traders—in a very subtle but powerful way—to keep an eye on the VIX and immediately recognize significant spikes or sharp decreases that should be factored in before entering a trade, or used as a quick signal to modify an existing position. In short: clear levels for the chart, live internals for the context, and a smarter, rules-based path to execution.
# Yelober – Market Internals + Key Levels
*A TradingView indicator for session key levels + real‑time market internals (NYSE/NASDAQ TICK, UVOL/DVOL/VOLD, and VIX).*
**Script name in Pine:** `Yelober - Market Internal direction+ Key levels` (Pine v6)
---
## 1) What this indicator does
**Purpose:** Help intraday traders quickly find high‑probability reaction zones and read market internals momentum without switching charts. It overlays yesterday/today’s **automatic price levels** on your active chart and shows a **market breadth table** that summarizes NYSE/NASDAQ buying pressure and TICK direction, with an optional VIX trend read.
### Key features at a glance
* **Automatic Price Levels (overlay on chart)**
  * Yesterday’s High/Low of Day (**yHoD**, **yLoD**)
  * Extended Hours High/Low (**yEHH**, **yEHL**) across yesterday AH + today pre‑market
  * Today’s Pre‑Market High/Low (**PMH**, **PML**)
  * Yesterday’s **Value Area High/Low** (**VAH/VAL**) and **Point of Control (POC)** computed from a volume profile of yesterday’s **regular session**
  * Smart de‑duplication:
    * Shows **only the higher** of (yEHH vs PMH) and **only the lower** of (yEHL vs PML) to avoid redundant bands
* **Market Breadth Table (on‑chart table)**
  * **NYSE ratio** = UVOL/DVOL (signed) with **VOLD slope** from session open
  * **NASDAQ ratio** = UVOLQ/DVOLQ (signed) with **VOLDQ slope** from session open
  * **TICK** and **TICKQ**: live cumulative ratio and short‑term slope
  * **VIX** (optional): current value + slope over a configurable lookback/timeframe
  * Color‑coded trends with sensible thresholds and optional normalization
---
## 2) How to use it (trader workflow)
1. **Mark your reaction zones**
   * Watch **yHoD/yLoD**, **PMH/PML**, and **VAH/VAL/POC** for first touches, break/retest, and failure tests.
   * Expect increased responsiveness when multiple levels cluster (e.g., PMH ≈ VAH ≈ daily pivot).
2. **Read the breadth panel for context**
   * **NYSE/NASDAQ ratio** (>1 = more up‑volume than down‑volume; <−1 = down‑dominant). Strong green across both favors long setups; red favors short setups.
   * **VOLD slopes** (NYSE & NASDAQ): positive and accelerating → broadening participation; negative → persistent pressure.
   * **TICK/TICKQ**: cumulative ratio and **slope arrows** (↗ / ↘ / →). Use the slope to gauge **near‑term thrust or fade**.
   * **VIX slope**: rising VIX (red) often coincides with risk‑off; falling VIX (green) with risk‑on.
3. **Confluence = higher confidence**
   * Example: Price reclaims **PMH** while **NYSE/NASDAQ ratios** print green and **TICK slopes** point ↗ — consider break‑and‑go; if VIX slope is ↘, that adds risk‑on confidence.
   * Example: Price rejects **VAH** while **VOLD slopes** roll negative and VIX ↗ — consider fade/reversal.
4. **Risk management**
   * Place stops just beyond key levels tested; if breadth flips, tighten or exit.
> **Timeframes:** Works best on 1–15m charts for intraday. Value Area is computed from **yesterday’s RTH**; choose a smaller calculation timeframe (e.g., 5–15m) for stable profiles.
---
## 3) Inputs & settings (what each option controls)
### Global Style
* **Enable all automatic price levels**: master toggle for yHoD/yLoD, yEHH/yEHL, PMH/PML, VAH/VAL/POC.
* **Line style/width**: applies to all drawn levels.
* **Label size/style** and **label color linking**: use the same color as the line or override with a global label color.
* **Maximum bars lookback**: how far the script scans to build yesterday metrics (performance‑sensitive).
### Value Area / Volume Profile
* **Enable Value Area calculations** *(on by default)*: computes yesterday’s **POC**, **VAH**, **VAL** from a simplified intraday volume profile built from yesterday’s **regular session bars**.
* **Max Volume Profile Points** *(default 50)*: lower values = faster; higher = more precise.
* **Value Area Calculation Timeframe** *(default 15)*: the security timeframe used when collecting yesterday’s highs/lows/volumes.
### Individual Level Toggles & Colors
* **yHoD / yLoD** (yesterday high/low)
* **yEHH / yEHL** (yesterday AH + today pre‑market extremes)
* **PMH / PML** (today pre‑market extremes)
* **VAH / VAL / POC** (yesterday RTH value area + point of control)
### Market Breadth Panel
* **Show NYSE / NASDAQ / VIX**: choose which series to display in the table.
* **Table Position / Size / Background Color**: UI placement and legibility.
* **Slope Averaging Periods** *(default 5)*: number of recent TICK/TICKQ ratio points used in slope calculation.
* **Candles for Rate** *(default 10)* & **Normalize Rate**: VIX slope calculation as % change between `now` and `n` candles ago; normalize divides by `n`.
* **VIX Timeframe**: optionally compute VIX on a higher TF (e.g., 15, 30, 60) for a smoother regime read.
* **Volume Normalization** (NYSE & NASDAQ): display VOLD slopes scaled to `tens/thousands/millions/10th millions` for readable magnitudes; color thresholds adapt to your choice.
---
## 4) Data sources & definitions
* **UVOL/VOLD (NYSE)** and **UVOLQ/DVOLQ/VOLDQ (NASDAQ)** via `request.security()`
  * **Ratio** = `UVOL/DVOL` (signed; negative when down‑volume dominates)
  * **VOLD slope** ≈ `(VOLD_now − VOLD_open) / bars_since_open`, then normalized per your setting
* **TICK/TICKQ**: cumulative sum of prints this session with **positives vs negatives ratio**, plus a simple linear regression **slope** of the last `N` ratio values
* **VIX**: value and slope across a user‑selected timeframe and lookback
* **Sessions (EST/EDT)**
  * **Regular:** 09:30–16:00
  * **Pre‑Market:** 04:00–09:30
  * **After Hours:** 16:00–20:00
* **Extended‑hours extremes** combine **yesterday AH** + **today PM**
> **Note:** All session checks are done with TradingView’s `time(…,"America/New_York")` context. If your broker’s RTH differs (e.g., futures), adjust expectations accordingly.
---
## 5) How the algorithms work (plain English)
### A) Key Levels
* **Yesterday’s RTH High/Low**: scans yesterday’s bars within 09:30–16:00 and records the extremes + bar indices.
* **Extended Hours**: scans yesterday AH and today PM to get **yEHH/yEHL**. Script shows **either yEHH or PMH** (whichever is **higher**) and **either yEHL or PML** (whichever is **lower**) to avoid duplicate bands stacked together.
* **Value Area & POC (RTH only)**
  * Build a coarse volume profile with `Max Volume Profile Points` buckets across the price range formed by yesterday’s RTH bars.
  * Distribute each bar’s volume uniformly across the buckets it spans (fast approximation to keep Pine within execution limits).
  * **POC** = bucket with max volume. **VA** expands from POC outward until **70%** of cumulative volume is enclosed → yields **VAH/VAL**.
### B) Market Breadth Table
* **NYSE/NASDAQ Ratio**: signed UVOL/DVOL with basic coloring.
* **VOLD Slopes**: from session open to current, normalized to human‑readable units; colors flip green/red based on thresholds that map to your normalization setting (e.g., ±2M for NYSE, ±3.5×10M for NASDAQ).
* **TICK/TICKQ Slope**: linear regression over the last `N` ratio points → **↗ / → / ↘** with the rounded slope value.
* **VIX Slope**: % change between now and `n` candles ago (optionally divided by `n`). Red when rising beyond threshold; green when falling.
---
## 6) Recommended presets
* **Stocks (liquid, intraday)**
  * Value Area **ON**, `Max Volume Points` = **40–60**, **Timeframe** = **5–15**
  * Breadth: show **NYSE & NASDAQ & VIX**, `Slope periods` = **5–8**, `Candles for rate` = **10–20**, **Normalize VIX** = **ON**
* **Index futures / very high‑volume symbols**
  * If you see Pine timeouts, set `Max Volume Points` = **20–40** or temporarily **disable Value Area**.
  * Keep breadth panel **ON** (it’s light). Consider **VIX timeframe = 15/30** for regime clarity.
---
## 7) Tips, edge cases & performance
* **Performance:** The volume profile is capped (`maxBarsToProcess ≤ 500` and bucketed) to keep it responsive. If you experience slowdowns, reduce `Max Volume Points`, `Maximum bars lookback`, or disable Value Area.
* **Redundant lines:** The script **intentionally suppresses** PMH/PML when yEHH/yEHL are more extreme, and vice‑versa.
* **Label visibility:** Use `Label style = none` if you only want clean lines and read values from the right‑end labels.
* **Futures/RTH differences:** Value Area is from **yesterday’s RTH** only; for 24h instruments the RTH period may not reflect overnight structure.
* **Session transitions:** PMH/PML tracking stops as soon as RTH starts; values persist as static levels for the session.
---
## 8) Known limitations
* Uses public TradingView symbols: `UVOL`, `VOLD`, `UVOLQ`, `DVOLQ`, `VOLDQ`, `TICK`, `TICKQ`, `VIX`. If your data plan or region limits any symbol, the corresponding table rows may show `na`.
* The VA/POC approximation assumes uniform distribution of each bar’s volume across its high–low. That’s fast but not a tick‑level profile.
* Works best on US equities with standard NY session; alternative sessions may need code changes.
---
## 9) Troubleshooting
* **“Script is too slow / timed out”** → Lower `Max Volume Points`, lower `Maximum bars lookback`, or toggle **OFF** `Enable Value Area calculations` for that instrument.
* **Missing breadth values** → Ensure the symbols above load on your account; try reloading chart or switching timeframes once.
* **Overlapping labels** → Set `Label style = none` or reduce label size.
---
## 10) Version / license / contribution
* **Version:** Initial public release (Pine v6).
* **Author:** © yelober 
* **License:** Free for community use and enhancement. Please keep author credit.
* **Contributing:** Open PRs/ideas: presets, alert conditions, multi‑day VA composites, optional mid‑value (`(VAH+VAL)/2`), session filter for futures, and alertable state machine for breadth regime transitions.
---
## 11) Quick start (TL;DR)
1. Add the indicator and **keep default settings**.
2. Trade **reactions** at yHoD/yLoD/PMH/PML/VAH/VAL/POC.
3. Use the **breadth table**: look for **green ratios + ↗ slopes** (risk‑on) or **red ratios + ↘ slopes** (risk‑off). Check **VIX** slope for confirmation.
4. Manage risk around levels; when breadth flips against you, tighten or exit.
---
### Changelog (public)
* **v1.0:** First community release with automatic RTH levels, VA/POC approximation, breadth dashboard (NYSE/NASDAQ/TICK/TICKQ/VIX) with normalization and adaptive color thresholds.
Pivot Points. High & Lows By Reversal PercentageLibrary   "Pivot Points. High & Lows By Reversal Percentage"  by Jal9000
This Pine Script library provides a robust function for identifying and tracking pivot points (reversal points) in price data, suitable for integration into custom trading indicators and strategies.
🛠️  Main Features: 
- ✅ Identifies pivot highs and lows based on configurable price movement thresholds.
- ✅ Lightweight. No candle backtracing used. Much less computation heavy.
- ✅ Supports multiple calls (with different values) within a single script.
- ✅ Compatible with  request.security  for multi-timeframe analysis.
- ✅ Returns both confirmed and temporary pivots for flexible integration.
- ✅ Pinescript V5 and V6 compliant code.
 Purpose: 
The  pivots  library enables Pine Script developers to easily add pivot point detection to their scripts. It identifies significant price reversals by evaluating price movements against a minimum range threshold ( min_range_pct ) and confirming reversals based on a percentage ( reversal_pct ) of the prior trend’s magnitude. The library supports multiple simultaneous calls with different settings, making it ideal for multi-timeframe strategies.
 How It Works: 
The library’s  f_calculatePivot  function tracks price movements to detect pivot points:
 
 Minimum Range Threshold : A potential pivot is considered if the price moves beyond the  min_range_pct  percentage of the current high (for a high pivot) or low (for a low pivot), ensuring sufficient movement.
 Reversal Confirmation : A pivot is confirmed if the price reverses from the potential pivot by at least the  reversal_pct  percentage of the distance between the last confirmed pivot and the current potential pivot, measuring the retracement relative to the prior trend’s magnitude.
 The function alternates between tracking highs (in an uptrend) and lows (in a downtrend), updating the trend when a pivot is confirmed.
 State management uses an array of  pivot_state  objects, allowing independent calculations for different  timeframes  and  min_range_pct  values within the same script.
 
 ## Technical Reference 
 Functions: 
 f_calculatePivot(series float _high, series float _low, float _min_range_pct, float _reversal_pct) →  
-  Parameters: 
 
 _high : The high price series (e.g.,  high  or  math.max(open, close) ).
 _low : The low price series (e.g.,  low  or  math.min(open, close) ).
 _min_range_pct : The minimum percentage price movement to consider a potential pivot.
 _reversal_pct : The percentage of the prior trend’s distance required to confirm a pivot.
 
  -  Returns: 
    A tuple containing:
 isNewPivot : Boolean indicating if a new pivot was confirmed.
 last_confirmed_pivot : The most recent confirmed pivot (type  pivot ).
 temp_pivot : The current temporary pivot (type  pivot ).
 
 Pivot type: 
 idx (series int) : Bar index of the pivot.
 typ (series int) : Type of pivot ( PIVOT_HIGH  or  PIVOT_LOW ).
 prc (series float) : Price of the pivot.
 tme (series int) : Timestamp of the pivot.
 
 Constants (internal): 
 TREND_LONG ,  TREND_SHORT : Trend direction indicators (1, -1).
 PIVOT_HIGH ,  PIVOT_LOW : Pivot type indicators (1, -1).
 
✨  Example of Use: 
  
//@version=5 
indicator("Pivot Example", overlay=true) 
import jal9000/pivots/1 as pivots
// Inputs
min_range_pct = input.float(20.0, 'Min Range %')
reversal_pct = input.float(30.0, 'Reversal %')
ignore_wick = input.bool(true, 'Ignore wick')
h = ignore_wick ? math.max(open, close) : high
l = ignore_wick ? math.min(open, close) : low
// Call the function with high, low, and input parameters
  = pivots.f_calculatePivot(h, l, min_range_pct, reversal_pct)
// Variable to store previous confirmed pivot outside the function
var pivots.pivot prev_confirmed_pivot = na
// Draw the line if a new pivot is confirmed and previous pivot exists
if is_new_pivot
    if not na(prev_confirmed_pivot) and not na(new_confirmed_pivot)
        line.new(x1 = prev_confirmed_pivot.idx, y1 = prev_confirmed_pivot.prc, x2 = new_confirmed_pivot.idx, y2 = new_confirmed_pivot.prc, color = color.blue, width = 1)
    prev_confirmed_pivot := new_confirmed_pivot
 
## Release Notes
 v1 
- Initial release of the  pivots  library with  f_calculatePivot  function for detecting pivot points and supporting multiple configurations and timeframes.
 v2 
- Code is Pinescript V6 ready. Remains identified as V5, but changing the version number is the only thing that is required to be v6.
Globex Trap w/ percentage [SLICKRICK]Globex Trap w/ Percentage  
Overview
The Globex Trap w/ Percentage indicator is a powerful tool designed to help traders identify high-probability trading opportunities by analyzing price action during the Globex (overnight) session and regular trading hours. By combining Globex session ranges with Supply & Demand zones, this indicator highlights potential "trap" areas where significant price reactions may occur. Additionally, it calculates the Globex session range as a percentage of the daily Average True Range (ATR), providing valuable context for assessing market volatility.
This indicator is ideal for traders in futures markets or other instruments traded during Globex sessions, offering a visual and analytical edge for spotting key price levels and potential reversals or breakouts.
Key Features
Globex Session Tracking:
Visualizes the high and low of the Globex session (default: 3:00 PM to 6:30 AM PST) with customizable time settings.
Displays a semi-transparent box to mark the Globex range, with labels for "Globex High" and "Globex Low."
Calculates the Globex range as a percentage of the daily ATR, displayed as a label for quick reference.
Supply & Demand Zones:
Identifies Supply & Demand zones during regular trading hours (default: 6:00 AM to 8:00 AM PST) with customizable time settings.
Draws semi-transparent boxes to highlight these zones, aiding in the identification of key support and resistance areas.
Trap Area Identification:
Highlights potential trap zones where Globex ranges and Supply & Demand zones overlap, indicating areas where price may reverse or consolidate due to trapped traders.
Customizable Settings:
Adjust Globex and Supply & Demand session times to suit your trading preferences.
Toggle visibility of Globex and Supply & Demand zones independently.
Customize box colors for better chart readability.
Set the lookback period (default: 10 days) to control how many historical zones are displayed.
Configure the ATR length (default: 14) for the percentage calculation.
PST Timezone Default:
All times are based on Pacific Standard Time (PST) by default, ensuring accurate session tracking for users in this timezone or those aligning with U.S. West Coast market hours.
Recommended Usage
Timeframes: Best used on 1-hour charts or lower (e.g., 15-minute, 5-minute) for precise entry and exit points.
Markets: Optimized for futures (e.g., ES, NQ, CL) and other instruments traded during Globex sessions.
Historical Data: Ensure at least 10 days of historical data for optimal visualization of zones.
Strategy Integration: Use the indicator to identify potential reversals or breakouts at Globex highs/lows or Supply & Demand zones. The ATR percentage provides context for whether the Globex range is significant relative to typical daily volatility.
How It Works
Globex Session:
Tracks the high and low prices during the user-defined Globex session (default: 3:00 PM to 6:30 AM PST).
When the session ends, a box is drawn from the start to the end of the session, capturing the high and low prices.
Labels are placed at the midpoint of the session, showing "Globex High," "Globex Low," and the range as a percentage of the daily ATR (e.g., "75.23% of Daily ATR").
Supply & Demand Zones:
Tracks the high and low prices during the user-defined regular trading hours (default: 6:00 AM to 8:00 AM PST).
Draws a box to mark these zones, which often act as key support or resistance levels.
ATR Percentage:
Calculates the Globex range (high minus low) and divides it by the daily ATR to express it as a percentage.
This metric helps traders gauge whether the overnight price movement is significant compared to the instrument’s typical volatility.
Time Handling:
Uses PST (UTC-8) for all time calculations, ensuring accurate session timing for users aligning with this timezone.
Properly handles overnight sessions that cross midnight, ensuring seamless tracking.
Input Settings
Globex Session Settings:
Show Globex Session: Enable/disable Globex session visualization (default: true).
Globex Start/End Time: Set the start and end times for the Globex session (default: 3:00 PM to 6:30 AM PST).
Globex Box Color: Customize the color of the Globex session box (default: semi-transparent gray).
Supply & Demand Zone Settings:
Show Supply & Demand Zone: Enable/disable zone visualization (default: true).
Zone Start/End Time: Set the start and end times for Supply & Demand zones (default: 6:00 AM to 8:00 AM PST).
Zone Box Color: Customize the color of the zone box (default: semi-transparent aqua).
General Settings:
Days to Look Back: Number of historical days to display zones (default: 10).
ATR Length: Period for calculating the daily ATR (default: 14).
Notes
All times are in Pacific Standard Time (PST). Adjust the start and end times if your market operates in a different timezone or if you prefer different session windows.
The indicator is optimized for instruments with active Globex sessions, such as futures. Results may vary for non-24/5 markets.
A typo in the label "Globe Low" (should be "Globex Low") will be corrected in future updates.
Ensure your TradingView chart is set to display sufficient historical data to view the full lookback period.
Why Use This Indicator?
The Globex Trap w/ Percentage indicator provides a unique combination of session-based range analysis, Supply & Demand zone identification, and volatility context via the ATR percentage. Whether you’re a day trader, swing trader, or scalper, this tool helps you:
Pinpoint key price levels where institutional traders may act.
Assess the significance of overnight price movements relative to daily volatility.
Identify potential trap zones for high-probability setups.
Customize the indicator to fit your trading style and market preferences.






















